How to start and stop a specific TiKV or PD instance in a TiKV cluster defined by topology.yaml?

This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: 如何启动和关闭由topology.yaml定义的TiKV集群中某一个TiKV或者PD实例?

| username: abelard2008

I want to practice the high availability of the TiKV cluster, such as shutting down one TiKV or PD instance in the cluster. On one server, I used the following topology.yaml file:

  user: "root"
  ssh_port: 22
#  deploy_dir: "/data/sdb/tikv-cluster/tikv-deploy"
#  data_dir: "/data/sdb/tikv-cluster/tikv-data"
        replication.location-labels: [host]
  - host:
    client_port: 2379
    peer_port: 2380
  - host:
    client_port: 12379
    peer_port: 12380
  - host:
    client_port: 22379
    peer_port: 22380

  - host:
    port: 20160
    status_port: 10080
    deploy_dir: "/data/sdb/tikv-cluster/tikv-deploy"
    data_dir: "/data/sdb/tikv-cluster/tikv-data"
            host: "tikv-20160"
  - host:
    port: 20161
    status_port: 10081
    deploy_dir: "/data/sdc/tikv-cluster/tikv-deploy"
    data_dir: "/data/sdc/tikv-cluster/tikv-data"
            host: "tikv-20161"
  - host:
    port: 20162
    status_port: 10082
    deploy_dir: "/data/sdd/tikv-cluster/tikv-deploy"
    data_dir: "/data/sdd/tikv-cluster/tikv-data"
            host: "tikv-20162"

  - host:

  - host:

  - host:

The current operation is normal:

[root@cs2-slice-node50 tikv-cluster]# tiup cluster display cluster-tikv
tiup is checking updates for component cluster ...
Starting component `cluster`: /root/.tiup/components/cluster/v1.11.1/tiup-cluster display cluster-tikv
Cluster type:       tidb
Cluster name:       cluster-tikv
Cluster version:    v5.3.0
Deploy user:        root
SSH type:           builtin
Dashboard URL:
Grafana URL:
ID                   Role          Host           Ports        OS/Arch       Status  Data Dir                                  Deploy Dir
--                   ----          ----           -----        -------       ------  --------                                  ----------   alertmanager  9093/9094    linux/x86_64  Up      /home/root/deploy/alertmanager-9093/data  /home/root/deploy/alertmanager-9093   grafana  3000         linux/x86_64  Up      -                                         /home/root/deploy/grafana-3000  pd    12379/12380  linux/x86_64  Up      /home/root/deploy/pd-12379/data           /home/root/deploy/pd-12379  pd    22379/22380  linux/x86_64  Up|L    /home/root/deploy/pd-22379/data           /home/root/deploy/pd-22379   pd    2379/2380    linux/x86_64  Up|UI   /home/root/deploy/pd-2379/data            /home/root/deploy/pd-2379   prometheus  9090         linux/x86_64  Up      /home/root/deploy/prometheus-9090/data    /home/root/deploy/prometheus-9090  tikv  20160/10080  linux/x86_64  Up      /data/sdb/tikv-cluster/tikv-data          /data/sdb/tikv-cluster/tikv-deploy  tikv  20161/10081  linux/x86_64  Up      /data/sdc/tikv-cluster/tikv-data          /data/sdc/tikv-cluster/tikv-deploy  tikv  20162/10082  linux/x86_64  Up      /data/sdd/tikv-cluster/tikv-data          /data/sdd/tikv-cluster/tikv-deploy
Total nodes: 9

I want to ask: How to gracefully shut down or start one of the TiKV or PD instances? Is there any related documentation? Thank you!

| username: 我是咖啡哥 | Original post link

For example, to stop one of the nodes:
tiup cluster stop <cluster-name> -N

| username: abelard2008 | Original post link

@我是咖啡哥 Thank you, is there any example documentation that describes, for example, the strings in --node strings? Of course, your answer already provided a perfect example.

| username: 我是咖啡哥 | Original post link

Yes, there is. Refer to the official documentation:

| username: 我是咖啡哥 | Original post link

The string is the ID column displayed.

| username: tidb菜鸟一只 | Original post link

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.