Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidb-in-kubernetes: add offline pump document #1555

Merged
merged 20 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
4135ab3
tidb-in-kubernetes, TOC: rename and add aliases for local PV file
junlan-zhang Aug 21, 2019
efac144
Merge remote-tracking branch 'upstream/master'
junlan-zhang Aug 26, 2019
ae87f67
Merge remote-tracking branch 'upstream/master'
junlan-zhang Aug 26, 2019
eb4ee43
resolve rename conflict with other PR
junlan-zhang Aug 26, 2019
5f06d72
Merge remote-tracking branch 'upstream/master'
junlan-zhang Aug 27, 2019
e71b7e1
Merge remote-tracking branch 'upstream/master'
junlan-zhang Aug 27, 2019
be79d57
Merge remote-tracking branch 'upstream/master'
junlan-zhang Aug 27, 2019
f5a3a30
undo unmerged changes
junlan-zhang Aug 28, 2019
ea91deb
Merge remote-tracking branch 'upstream/master'
junlan-zhang Aug 29, 2019
3226b9a
tidb-in-kubernetes: add offline pump document
junlan-zhang Sep 27, 2019
6a167bb
fix format and update content
junlan-zhang Sep 27, 2019
013fc08
Merge remote-tracking branch 'upstream/master' into add-offline-pump-…
junlan-zhang Sep 29, 2019
42f5dea
tidb-in-kubernetes: modify the header
junlan-zhang Oct 11, 2019
2db7726
Merge branch 'master' into add-offline-pump-document
junlan-zhang Oct 11, 2019
e28cded
tidb-in-kubernetes: modify the header
junlan-zhang Oct 12, 2019
1189912
tidb-in-kubernetes: wording edits
junlan-zhang Oct 12, 2019
c0283e4
tidb-in-kubernetes: modify wording
junlan-zhang Oct 12, 2019
03d75da
Merge branch 'master' into add-offline-pump-document
yikeke Oct 14, 2019
6f8d2b4
Merge branch 'master' into add-offline-pump-document
yikeke Oct 14, 2019
d63e98c
Merge branch 'master' into add-offline-pump-document
yikeke Oct 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).

### Decrease the capability of Pump
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Scale down instead of Decrease the capability of?


To decrease the capability of Pump, make Pump nodes offline and then run the `helm upgrade` command to delete Pump pods.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To decrease the capability of Pump, make Pump nodes offline and then run the `helm upgrade` command to delete Pump pods.
To scale Pump in, you decrease the number of Pump nodes by taking the nodes offline one at a time and running the `helm upgrade` command to delete the corresponding Pump Pod. The steps are as follows:

"Pod" needs to be capitalized. ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/


1. Make Pump nodes offline from the TiDB cluster
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Make Pump nodes offline from the TiDB cluster
1. Make the 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
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 Pump pods
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Delete Pump pods
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 Pump pods.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Modify `binlog.pump.replicas` in the `values.yaml` file to `2` and then, run the following command to delete Pump pods.
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).

### Decrease the capability of Pump

To decrease the capability of Pump, make Pump nodes offline and then run the `helm upgrade` command to delete Pump pods.
yikeke marked this conversation as resolved.
Show resolved Hide resolved

1. Make Pump nodes 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 Pump pods

Modify `binlog.pump.replicas` in the `values.yaml` file to `2` and then, run the following command to delete Pump pods.

{{< copyable "shell-regular" >}}

```shell
helm upgrade <release-name> pingcap/tidb-cluster -f values.yaml --version=<chart-version>
```