Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 如何启动和关闭由topology.yaml定义的TiKV集群中某一个TiKV或者PD实例?
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:
global:
user: "root"
ssh_port: 22
# deploy_dir: "/data/sdb/tikv-cluster/tikv-deploy"
# data_dir: "/data/sdb/tikv-cluster/tikv-data"
server_configs:
pd:
replication.location-labels: [host]
pd_servers:
- host: 192.168.127.50
client_port: 2379
peer_port: 2380
- host: 192.168.127.50
client_port: 12379
peer_port: 12380
- host: 192.168.127.50
client_port: 22379
peer_port: 22380
tikv_servers:
- host: 192.168.127.50
port: 20160
status_port: 10080
deploy_dir: "/data/sdb/tikv-cluster/tikv-deploy"
data_dir: "/data/sdb/tikv-cluster/tikv-data"
config:
server.labels:
host: "tikv-20160"
- host: 192.168.127.50
port: 20161
status_port: 10081
deploy_dir: "/data/sdc/tikv-cluster/tikv-deploy"
data_dir: "/data/sdc/tikv-cluster/tikv-data"
config:
server.labels:
host: "tikv-20161"
- host: 192.168.127.50
port: 20162
status_port: 10082
deploy_dir: "/data/sdd/tikv-cluster/tikv-deploy"
data_dir: "/data/sdd/tikv-cluster/tikv-data"
config:
server.labels:
host: "tikv-20162"
monitoring_servers:
- host: 192.168.127.50
grafana_servers:
- host: 192.168.127.50
alertmanager_servers:
- host: 192.168.127.50
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: http://192.168.127.50:2379/dashboard
Grafana URL: http://192.168.127.50:3000
ID Role Host Ports OS/Arch Status Data Dir Deploy Dir
-- ---- ---- ----- ------- ------ -------- ----------
192.168.127.50:9093 alertmanager 192.168.127.50 9093/9094 linux/x86_64 Up /home/root/deploy/alertmanager-9093/data /home/root/deploy/alertmanager-9093
192.168.127.50:3000 grafana 192.168.127.50 3000 linux/x86_64 Up - /home/root/deploy/grafana-3000
192.168.127.50:12379 pd 192.168.127.50 12379/12380 linux/x86_64 Up /home/root/deploy/pd-12379/data /home/root/deploy/pd-12379
192.168.127.50:22379 pd 192.168.127.50 22379/22380 linux/x86_64 Up|L /home/root/deploy/pd-22379/data /home/root/deploy/pd-22379
192.168.127.50:2379 pd 192.168.127.50 2379/2380 linux/x86_64 Up|UI /home/root/deploy/pd-2379/data /home/root/deploy/pd-2379
192.168.127.50:9090 prometheus 192.168.127.50 9090 linux/x86_64 Up /home/root/deploy/prometheus-9090/data /home/root/deploy/prometheus-9090
192.168.127.50:20160 tikv 192.168.127.50 20160/10080 linux/x86_64 Up /data/sdb/tikv-cluster/tikv-data /data/sdb/tikv-cluster/tikv-deploy
192.168.127.50:20161 tikv 192.168.127.50 20161/10081 linux/x86_64 Up /data/sdc/tikv-cluster/tikv-data /data/sdc/tikv-cluster/tikv-deploy
192.168.127.50:20162 tikv 192.168.127.50 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!