is a cluster operation and maintenance tool. TiUP provides TiUP cluster, a cluster management component written in Golang. By using TiUP cluster, you can easily do daily operations, including deploying, starting, stopping, destroying, scaling, and upgrading a TiKV cluster, and manage cluster parameters.

Log in to the control machine using a regular user account (take the user as an example). All the following TiUP installation and cluster management operations can be performed by the tikv user.

  1. Install TiUP by executing the following command:

  2. Set the TiUP environment variables:

    Redeclare the global environment variables:

    1. source .bash_profile

    Confirm whether TiUP is installed:

    1. tiup
  3. Install the TiUP cluster component:

    1. tiup cluster
  4. Verify the current version of your TiUP cluster:

    1. tiup --binary cluster

Step 2: Initialize cluster topology file

According to the intended cluster topology, you need to manually create and edit the cluster initialization configuration file.

To create the cluster initialization configuration file, you can create a YAML-formatted configuration file on the control machine using TiUP:

  1. tiup cluster template > topology.yaml

Execute vi topology.yaml to edit the configuration file content:

  1. user: "tikv"
  2. ssh_port: 22
  3. deploy_dir: "/tikv-deploy"
  4. data_dir: "/tikv-data"
  5. server_configs: {}
  6. pd_servers:
  7. - host: 10.0.1.1
  8. - host: 10.0.1.2
  9. - host: 10.0.1.3
  10. tikv_servers:
  11. - host: 10.0.1.4
  12. - host: 10.0.1.6
  13. monitoring_servers:
  14. - host: 10.0.1.7
  15. grafana_servers:
  • For parameters that should be globally effective, configure these parameters of corresponding components in the server_configs section of the configuration file.
  • For parameters that should be effective on a specific node, configure these parameters in the config of this node.
  • Use . to indicate the subcategory of the configuration, such as storage.scheduler-concurrency. For more formats, see .
  • For more parameter description, see TiKV config.toml.example, configuration.

You can use secret keys or interactive passwords for security authentication when you deploy TiKV using TiUP:

  • If you use secret keys, you can specify the path of the keys through -i or --identity_file;
  • If you use passwords, add the -p flag to enter the password interaction window;
  • If password-free login to the target machine has been configured, no authentication is required.

In general, TiUP creates the user and group specified in the topology.yaml file on the target machine, with the following exceptions:

  • The user name configured in topology.yaml already exists on the target machine.
  • You have used the --skip-create-user option in the command line to explicitly skip the step of creating the user.

Before you execute the deploy command, use the check and check --apply commands to detect and automatically repair the potential risks in the cluster:

In the above command:

  • The name of the deployed TiKV cluster is tikv-test.
  • You can see the latest supported versions by running tiup list tikv. This document takes v5.0.1 as an example.
  • The initialization configuration file is topology.yaml.
  • --user root: Log in to the target machine through the root key to complete the cluster deployment, or you can use other users with ssh and sudo privileges to complete the deployment.
  • [-i] and [-p]: optional. If you have configured login to the target machine without password, these parameters are not required. If not, choose one of the two parameters. [-i] is the private key of the root user (or other users specified by --user) that has access to the target machine. [-p] is used to input the user password interactively.
  • If you need to specify the user group name to be created on the target machine, see .

At the end of the output log, you will see Deployed cluster `tikv-test` successfully. This indicates that the deployment is successful.

Step 4: Check the clusters managed by TiUP

    TiUP supports managing multiple TiKV clusters. The command above outputs information of all the clusters currently managed by TiUP, including the name, deployment user, version, and secret key information.

    For example, execute the following command to check the status of the tikv-test cluster:

    1. tiup cluster display tikv-test

    Expected output includes the instance ID, role, host, listening port, and status (because the cluster is not started yet, so the status is Down/), and directory information.

    Step 6: Start the TiKV cluster

    If the output log includes Started cluster `tikv-test` successfully, the deployment is successful.

    For the specific operations, see Verify Cluster Status.