## Module 2: Scale Out TiKV cluster

+ In this module, participants will manually add a TiKV node to the TiKV cluster for scaling out. During the scaling out process, they will observe whether the TiDB Cluster initiates balancing. However, participants will notice that balancing has not started. The next step will involve troubleshooting this issue.

### Step 1. Add one TiKV server to the cluster

+ Switch back to [Terminal 1](ssh://monitor1-ssh#1). Scale out the storage layer by adding 1 TiKV server.

   ```bash
   cat scale-out-tikv.yaml
   ```

   ```output
   tikv_servers:
   - host: 10.90.1.192
      port: 20160
      status_port: 20180
   ```

   ```bash
   ~/.tiup/bin/tiup cluster scale-out tidb-demo scale-out-tikv.yaml --user ec2-user -i ~/.ssh/pe-class-key-${LAB:REGION_NAME}.pem -y
   ```

   ```output
   ...
   Scaled cluster `tidb-demo` out successfully
   ```

### Step 2. Check TiDB cluster status

+ Verify there are 4 `tikv` servers in the TiDB cluster now, you scaled TiKV layer size from 3 to 4.

   ```bash
   ~/.tiup/bin/tiup cluster display tidb-demo
   ```

   ```output
   Cluster type:       tidb
   Cluster name:       tidb-demo
   Cluster version:    v${LAB:TIDB_VERSION}
   Deploy user:        ec2-user
   SSH type:           builtin
   Dashboard URL:      http://35.74.236.1:2379/dashboard
   Grafana URL:        http://10.90.4.196:3000
   ID                 Role          Host         Ports        OS/Arch       Status  Data Dir                      Deploy Dir
   --                 ----          ----         -----        -------       ------  --------                      ----------
   10.90.4.196:9093   alertmanager  10.90.4.196  9093/9094    linux/x86_64  Up      /tidb-data/alertmanager-9093  /tidb-deploy/alertmanager-9093
   10.90.4.196:3000   grafana       10.90.4.196  3000         linux/x86_64  Up      -                             /tidb-deploy/grafana-3000
   10.90.2.178:2379   pd            10.90.2.178  2379/2380    linux/x86_64  Up|L    /tidb-data/pd-2379            /tidb-deploy/pd-2379
   10.90.4.196:9090   prometheus    10.90.4.196  9090/12020   linux/x86_64  Up      /tidb-data/prometheus-9090    /tidb-deploy/prometheus-9090
   10.90.1.140:4000   tidb          10.90.1.140  4000/10080   linux/x86_64  Up      -                             /tidb-deploy/tidb-4000
   10.90.1.169:20160  tikv          10.90.1.169  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160
   10.90.1.192:20160  tikv          10.90.1.192  20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160
   10.90.1.88:20160   tikv          10.90.1.88   20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160
   10.90.1.99:20160   tikv          10.90.1.99   20160/20180  linux/x86_64  Up      /tidb-data/tikv-20160         /tidb-deploy/tikv-20160
   10.90.4.196:6000   tiproxy       10.90.4.196  6000/3080    linux/x86_64  Up      -                             /tidb-deploy/tiproxy-6000
   Total nodes: 10
   ```

### Step 3. Observe whether PD has initiated balancing for the TiKV cluster after the scaling out

+ Return to the `tidb-demo-PD` section of [Grafana Dashboard](http://${LAB:HOST_MONITOR1_PUBLIC_IP}:3000). In the upper section of `tidb-demo-PD`, you can see that `Online store progress` is `No Data`, `Left time` is `N/A`, and `Current scaling speed` is `0 MB/s`. This indicates that PD has not initiated balancing for TiKV. The next module will address this issue.

  ![70%](https://lab-static.pingcap.com/images/2025/7/24/adb4348802beb9d2722289e55e99d477906e6bc8.png)
