安装
安装tiup
[root@localhost ~]# curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
[root@localhost ~]# source .bash_profile
[root@localhost ~]# which tiup
搭建集群指定DB PD KV
2台db-server 3台pd-server 3台kv-server
如果没有设置host,就默认是127.0.0.1,只能本机联上tidb了
[root@localhost ~]# tiup playground v6.1.0 --db 2 --pd 3 --kv 3 --host 192.168.1.128
效果:
注意,要关防火墙
#systemctl stop firewalld
#systemctl disable firewalld
Connect TiDB: mysql --comments --host 192.168.1.128 --port 4001 -u root
Connect TiDB: mysql --comments --host 192.168.1.128 --port 4000 -u root
TiDB Dashboard: http://192.168.1.128:2379/dashboard
Grafana: http://192.168.1.128:3000
也可以连4001
清掉集群
# tiup clean -all
创建时指定集群名
[root@localhost ~]# tiup playground v6.1.0 --tag example --db 2 --pd 3 --kv 3 --host 192.168.1.128
清掉指定的集群
#tiup clean example