diff --git a/dev/tidb-in-kubernetes/maintain/backup-and-restore.md b/dev/tidb-in-kubernetes/maintain/backup-and-restore.md index 09188c4b67177..4c59adc32e7af 100644 --- a/dev/tidb-in-kubernetes/maintain/backup-and-restore.md +++ b/dev/tidb-in-kubernetes/maintain/backup-and-restore.md @@ -126,3 +126,35 @@ The `pingcap/tidb-backup` helm chart helps restore a TiDB cluster using backup d Incremental backup uses [TiDB Binlog](/dev/reference/tidb-binlog-overview.md) to collect binlog data from TiDB and provide real-time backup and replication to downstream platforms. For the detailed guide of maintaining TiDB Binlog in Kubernetes, refer to [TiDB Binlog](/dev/tidb-in-kubernetes/maintain/tidb-binlog.md). + +### Scale in Pump + +To scale in Pump, for each Pump node, make the node offline and then run the `helm upgrade` command to delete the corresponding Pump Pod. + +1. Make a Pump node offline from the TiDB cluster + + Suppose there are 3 Pump nodes, and you want to get the third node offline and modify `` to `2`, run the following command (`` is the current version of TiDB). + + {{< copyable "shell-regular" >}} + + ```shell + kubectl run offline-pump- --image=pingcap/tidb-binlog: --namespace= --restart=OnFailure -- /binlogctl -pd-urls=http://-pd:2379 -cmd offline-pump -node-id -pump-:8250 + ``` + + Then, check the log output of Pump. If Pump outputs `pump offline, please delete my pod`, the state of the Pump node is successfully switched to `offline`. + + {{< copyable "shell-regular" >}} + + ```shell + kubectl logs -f -n -pump- + ``` + +2. Delete the corresponding Pump Pod + + Modify `binlog.pump.replicas` in the `values.yaml` file to `2` and then run the following command to delete the Pump Pod. + + {{< copyable "shell-regular" >}} + + ```shell + helm upgrade pingcap/tidb-cluster -f values.yaml --version= + ``` diff --git a/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md b/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md index 656669937f2aa..19262ea2d088f 100644 --- a/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md +++ b/v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md @@ -127,3 +127,35 @@ The `pingcap/tidb-backup` helm chart helps restore a TiDB cluster using backup d Incremental backup uses [TiDB Binlog](/v3.0/reference/tidb-binlog-overview.md) to collect binlog data from TiDB and provide real-time backup and replication to downstream platforms. For the detailed guide of maintaining TiDB Binlog in Kubernetes, refer to [TiDB Binlog](/v3.0/tidb-in-kubernetes/maintain/tidb-binlog.md). + +### Scale in Pump + +To scale in Pump, for each Pump node, make the node offline and then run the `helm upgrade` command to delete the corresponding Pump Pod. + +1. Make a Pump node offline from the TiDB cluster + + Suppose there are 3 Pump nodes, and you want to get the third node offline and modify `` to `2`, run the following command (`` is the current version of TiDB). + + {{< copyable "shell-regular" >}} + + ```shell + kubectl run offline-pump- --image=pingcap/tidb-binlog: --namespace= --restart=OnFailure -- /binlogctl -pd-urls=http://-pd:2379 -cmd offline-pump -node-id -pump-:8250 + ``` + + Then, check the log output of Pump. If Pump outputs `pump offline, please delete my pod`, the state of the Pump node is successfully switched to `offline`. + + {{< copyable "shell-regular" >}} + + ```shell + kubectl logs -f -n -pump- + ``` + +2. Delete the corresponding Pump Pod + + Modify `binlog.pump.replicas` in the `values.yaml` file to `2` and then run the following command to delete the Pump Pod. + + {{< copyable "shell-regular" >}} + + ```shell + helm upgrade pingcap/tidb-cluster -f values.yaml --version= + ``` \ No newline at end of file