Skip to content

Commit

Permalink
en: update doc for tidb cluster scaling (#111)
Browse files Browse the repository at this point in the history
* Update scale-a-tidb-cluster.md

* Apply suggestions from code review

Co-Authored-By: TomShawn <41534398+TomShawn@users.noreply.github.com>

Co-authored-by: TomShawn <41534398+TomShawn@users.noreply.github.com>
  • Loading branch information
ran-huang and TomShawn authored Mar 31, 2020
1 parent 7eff931 commit 9dbf138
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions en/scale-a-tidb-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ This document introduces how to horizontally and vertically scale a TiDB cluster

Horizontally scaling TiDB means that you scale TiDB out or in by adding or remove nodes in your pool of resources. When you scale a TiDB cluster, PD, TiKV, and TiDB are scaled out or in sequentially according to the values of their replicas. Scaling out operations add nodes based on the node ID in ascending order, while scaling in operations remove nodes based on the node ID in descending order.

### Horizontal scaling operations
Currently, the TiDB cluster supports management by Helm or by TidbCluster Custom Resource (CR). You can choose the scaling method based on the management method of your TiDB cluster.

To perform a horizontal scaling operation:
### Horizontal scaling operations (Helm)

To perform a horizontal scaling operation, take the following steps:

1. Modify `pd.replicas`, `tidb.replicas`, `tikv.replicas` in the `value.yaml` file of the cluster to a desired value.

Expand All @@ -26,15 +28,21 @@ To perform a horizontal scaling operation:
helm upgrade <release-name> pingcap/tidb-cluster -f values.yaml --version=<chart_version>
```

3. View the cluster's scaling status:
### Horizontal scaling operations (CR)

{{< copyable "shell-regular" >}}
Modify `spec.pd.replicas`, `spec.tidb.replicas`, and `spec.tikv.replicas` in the `TidbCluster` object that corresponds to the cluster to the desired values using kubectl.

```shell
watch kubectl -n <namespace> get pod -o wide
```
### View the scaling status

To view the scaling status of the cluster, run the following command:

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

```shell
watch kubectl -n <namespace> get pod -o wide
```

When the number of Pods for all components reaches the preset value and all components go to the `Running` state, the horizontal scaling is completed.
When the number of Pods for all components reaches the preset value and all components go to the `Running` state, the horizontal scaling is completed.

> **Note:**
>
Expand All @@ -47,7 +55,9 @@ To perform a horizontal scaling operation:
Vertically scaling TiDB means that you scale TiDB up or down by increasing or decreasing the limit of resources on the node. Vertically scaling is essentially the rolling update of the nodes.
### Vertical scaling operations
Currently, the TiDB cluster supports management by Helm or by TidbCluster Custom Resource (CR). You can choose the scaling method based on the management method of your TiDB cluster.
### Vertical scaling operations (Helm)
To perform a vertical scaling operation:
Expand All @@ -61,15 +71,21 @@ To perform a vertical scaling operation:
helm upgrade <release-name> pingcap/tidb-cluster -f values.yaml --version=<chart_version>
```
3. View the progress of the upgrade:
### Vertical scaling operations (CR)
{{< copyable "shell-regular" >}}
Modify `spec.pd.resources`, `spec.tikv.resources`, and `spec.tikv.resources` in the `TidbCluster` object that corresponds to the cluster to the desired values using kubectl.
```shell
watch kubectl -n <namespace> get pod -o wide
```
### View the upgrade progress
To view the upgrade progress of the cluster, run the following command:
{{< copyable "shell-regular" >}}
```shell
watch kubectl -n <namespace> get pod -o wide
```
When all Pods are rebuilt and in the `Running` state, the vertical scaling is completed.
When all Pods are rebuilt and in the `Running` state, the vertical scaling is completed.
> **Note:**
>
Expand Down

0 comments on commit 9dbf138

Please sign in to comment.