Skip to content

Commit

Permalink
tidb-in-kubernetes: add offline pump document (#1555)
Browse files Browse the repository at this point in the history
* tidb-in-kubernetes, TOC: rename and add aliases for local PV file

* resolve rename conflict with other PR

* undo unmerged changes

* tidb-in-kubernetes: add offline pump document

* fix format and update content

* tidb-in-kubernetes: modify the header

* tidb-in-kubernetes: modify the header

* tidb-in-kubernetes: wording edits

* tidb-in-kubernetes: modify wording
  • Loading branch information
junlan-zhang authored and yikeke committed Oct 14, 2019
1 parent 7efd8cf commit b1dcb66
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions dev/tidb-in-kubernetes/maintain/backup-and-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<ordinal-id>` to `2`, run the following command (`<version>` is the current version of TiDB).
{{< copyable "shell-regular" >}}
```shell
kubectl run offline-pump-<ordinal-id> --image=pingcap/tidb-binlog:<version> --namespace=<namespace> --restart=OnFailure -- /binlogctl -pd-urls=http://<release-name>-pd:2379 -cmd offline-pump -node-id <release-name>-pump-<ordinal-id>: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 <namespace> <release-name>-pump-<ordinal-id>
```
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 <release-name> pingcap/tidb-cluster -f values.yaml --version=<chart-version>
```
32 changes: 32 additions & 0 deletions v3.0/tidb-in-kubernetes/maintain/backup-and-restore.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<ordinal-id>` to `2`, run the following command (`<version>` is the current version of TiDB).
{{< copyable "shell-regular" >}}
```shell
kubectl run offline-pump-<ordinal-id> --image=pingcap/tidb-binlog:<version> --namespace=<namespace> --restart=OnFailure -- /binlogctl -pd-urls=http://<release-name>-pd:2379 -cmd offline-pump -node-id <release-name>-pump-<ordinal-id>: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 <namespace> <release-name>-pump-<ordinal-id>
```
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 <release-name> pingcap/tidb-cluster -f values.yaml --version=<chart-version>
```

0 comments on commit b1dcb66

Please sign in to comment.