This document describes how to scale a TiKV or PD cluster using TiUP.

For example, assume that the topology of the cluster is as follows:

If you want to add a TiKV node to the host, take the following steps.

  1. Configure the scale-out topology

    Put the following contents in the scale-out-tikv.yaml file:

    To view the configuration of the current cluster, run tiup cluster edit-config <cluster-name>. Because the parameter configuration of global and server_configs is inherited by scale-out-tikv.yaml and thus also takes effect in scale-out-tikv.yaml.

  2. Run the scale-out command

    If you see the message “Scaled cluster out successfully”, it means that the scale-out operation is successfully completed.

After the scale-out, the cluster topology is as follows:

If you want to add a PD node to the 10.0.1.9 host, take the following steps.

  1. Configure the scale-out topology

    Put the following contents in the scale-out-pd.yaml file:

    To view the configuration of the current cluster, run tiup cluster edit-config <cluster-name>. Because the parameter configuration of global and server_configs is inherited by and thus also takes effect in scale-out-pd.yaml.

  2. Run the scale-out command

    1. tiup cluster scale-out <cluster-name> scale-out-pd.yaml

    If you see the message “Scaled cluster out successfully”, it means that the scale-out operation is successfully completed.

  3. Check the cluster status

      Access the monitoring platform at using your browser to monitor the status of the cluster and the new node.

    If you want to remove a TiKV node from the 10.0.1.5 host, take the following steps.

    You can take similar steps to remove a PD node.

    1. View the node ID information:

    2. Run the scale-in command:

      1. tiup cluster scale-in <cluster-name> --node 10.0.1.5:20160

      The --node parameter is the ID of the node to be taken offline.

      If you see the message “Scaled cluster in successfully”, it means that the scale-in operation is successfully completed.

      Besides, if the status of the node to be taken offline becomes , it also indicates that the scale-in operation is successfully completed because the scale-in process takes some time.

    3. Check the cluster status:

      To check the scale-in status, run the following command:

      1. tiup cluster display <cluster-name>

    After the scale-in, the current topology is as follows: