TiKV

TiUP

https://tikv.org/docs/7.1/deploy/install/production/

prepare

1
2
3
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh

source .bash_profile

cluster component

1
2
3
4
5
6
7
8
# install cluster component
tiup cluster

# update cluster component
tiup update --self && tiup update cluster

# verify version
tiup --binary cluster

Initialize cluster topology file

1
2
# init template
tiup cluster template > topology.yaml

topoloy.yaml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
global:
user: "tikv"
ssh_port: 22
deploy_dir: "/tikv-deploy"
data_dir: "/tikv-data"
server_configs: {}
pd_servers:
- host: 10.0.1.1
- host: 10.0.1.2
- host: 10.0.1.3
tikv_servers:
- host: 10.0.1.4
- host: 10.0.1.5
- host: 10.0.1.6
monitoring_servers:
- host: 10.0.1.7
grafana_servers:
- host: 10.0.1.7

precheck environment

1
2
3
4
5
6
7
8
9
# Dry-run first (see failures)
tiup cluster check ./topology.yaml

# # Auto-fix + check
tiup cluster check ./topology.yaml --apply

# or
tiup cluster check ./topology.yaml --user <userName> -i ~/.ssh/id_rsa
tiup cluster check ./topology.yaml --apply --user <userName> -i ~/.ssh/id_rsa

deploy

1
2
3
4
5
6
7
8
9
10
11
# list tikv version
tiup list tikv

# optional: enable writeable .ssh/authorized_keys, TiUP stores its own key pair in ~/.tiup/storage/cluster/clusters/<cluster_name>/ssh/  (id_rsa + id_rsa.pub).
sudo chattr -i authorized_keys

# deploy
tiup cluster deploy <clusterName> <tikvVersion> ./topology.yaml

# or e.g.
tiup cluster deploy tikv-test v8.5.5 ./topology.yaml --user root -i ~/.ssh/id_rsa

start

1
2
3
4
tiup cluster start <clusterName>

# e.g.
tiup cluster start tikv-dingofs --init

status

1
2
3
4
5
# list
tiup cluster list

# status
tiup cluster display <clusterName>

uninstall

1
2
3
4
5
6
7
8
9
10
11
12
13
# destroy cluster 
tiup cluster destroy <cluster-name> [flags]

tiup cluster destroy command performs the following operations:
1. Stops the cluster.
2. For each service, delete its log directory, deployment directory, and data directory.
3. If the parent directory of the data directory or deployment directory of each service is created by tiup-cluster, also delete the parent directory.

# other: stop cluster
tiup cluster stop <cluster-name> [flags]

# other: uninstall component
tiup uninstall <component1>:<version> [component2...N] [flags]

monitor

1
2
# grafana, default login admin/admin
${Grafana-ip}:3000