# Online Scale in (TiDB/TikV/PD)

__*TiDB online scale in*__
__*TiDB Server Online scale in*__
__*TiKV online scale in*__
__*PD online scale in*__


+ Step 1: View node ID information
  + `tiup cluster display <cluster-name>`

+ Step 2: Execute the scale in operation
  + `tiup cluster scale-in <cluster-name> --node <node-IP>:<node-Port>`

+ Step 3: Check the cluster status
  + `tiup cluster display <cluster-name>`

-------------------------------------------------------------
The steps for removing TiDB, PD nodes, and TiKV nodes are similar. Here we take the example of removing a TiKV node with IP address 10.0.1.5:

Step 1: View node ID information
tiup cluster display <cluster-name>
As a result, we found a TiKV node with an IP address of 10.0.1.5.
```
Starting /root/.tiup/components/cluster/v1.3.0/cluster display <cluster-name> 

TiDB Cluster: <cluster-name>

TiDB Version: v5.0.0

ID              Role         Host        Ports                            Status  Data Dir                Deploy Dir

--              ----         ----        -----                            ------  --------                ----------

10.0.1.3:8300   cdc         10.0.1.3     8300                                Up      -                       deploy/cdc-8300
10.0.1.4:8300   cdc         10.0.1.4     8300                                Up      -                       deploy/cdc-8300
10.0.1.4:2379   pd           10.0.1.4    2379/2380                        Healthy data/pd-2379            deploy/pd-2379

10.0.1.1:20160  tikv         10.0.1.1    20160/20180                      Up      data/tikv-20160         deploy/tikv-20160

10.0.1.2:20160  tikv         10.0.1.2    20160/20180                      Up      data/tikv-20160         deploy/tikv-20160

10.0.1.5:20160  tikv         10.0.1.5    20160/20180                      Up      data/tikv-20160         deploy/tikv-20160

10.0.1.3:4000   tidb         10.0.1.3    4000/10080                       Up      -                       deploy/tidb-4000

10.0.1.4:4000   tidb         10.0.1.4    4000/10080                       Up      -                       deploy/tidb-4000

10.0.1.5:4000   tidb         10.0.1.5    4000/10080                       Up      -                       deploy/tidb-4000

10.0.1.3:9000   tiflash      10.0.1.3    9000/8123/3930/20170/20292/8234  Up      data/tiflash-9000       deploy/tiflash-9000

10.0.1.4:9000   tiflash      10.0.1.4    9000/8123/3930/20170/20292/8234  Up      data/tiflash-9000       deploy/tiflash-9000

10.0.1.5:9090   prometheus   10.0.1.5    9090                             Up      data/prometheus-9090    deploy/prometheus-9090

10.0.1.5:3000   grafana      10.0.1.5    3000                             Up      -                       deploy/grafana-3000

10.0.1.5:9093   alertmanager 10.0.1.5    9093/9094                        Up      data/alertmanager-9093  deploy/alertmanager-9093
```

Step 2: Execute the scale in operation
tiup cluster scale-in <cluster-name>—node<node-IP>: <node-Port>
The —node parameter is the ID of the node that needs to be offline.
Scaled cluster <cluster-name>in scaling information is expected to be output, indicating that scale in operation was successful.

Step 3: Check the cluster status
It takes a certain amount of time to go offline. If the status of the offline node changes to Tombstone, the offline node is successful.
Execute the following command to check if the node went offline successfully:
tiup cluster display <cluster-name>

Please refer to the documentation: https://docs.pingcap.com/zh/tidb/stable/scale-tidb-using-tiup