Sign InTry Free

Restart a TiDB Cluster in Kubernetes

If you find that the memory leak occurs in a Pod during use, you need to restart the cluster. This document describes how to perform a graceful rolling restart to all the Pods in a component of the TiDB cluster, or gracefully log off a Pod in the TiDB cluster and then restart the Pod using the graceful restart command.

Performing a graceful rolling restart to all Pods in a component

After Deploying TiDB on general Kubernetes, modify the cluster configuration by running the following command:

kubectl edit tc ${name} -n ${namespace}

Add in the annotation of the spec of the TiDB component you want to gracefully rolling restart, and set its value to be the current time.

In the following example, annotations of the pd, tikv, and tidb components are set, which means that all the Pods in these three components will be gracefully rolling restarted. You can set the annotation for a specific component according to your needs.

apiVersion: kind: TidbCluster metadata: name: basic spec: version: v5.3.0 timezone: UTC pvReclaimPolicy: Delete pd: ... annotations: 2020-04-20T12:00 tikv: ... annotations: 2020-04-20T12:00 tidb: ... annotations: 2020-04-20T12:00

Was this page helpful?

Download PDFRequest docs changesAsk questions on Discord
One-stop & interactive experience of TiDB's capabilities WITHOUT registration.
TiDB Dedicated
TiDB Serverless
Get Demo
Get Started
© 2023 PingCAP. All Rights Reserved.
Privacy Policy.