安装binlog(pump)
环境:
pump_servers:192.168.1.118,192.168.1.85,192.168.1.134
当前环境已经安装好了tidb集群,只能使用扩容的方式安装binlog
下面操作在中控台的机器上执行,我这里是在192.168.1.118这台机器
1.编辑文件
[root@localhost ~]# cd /tmp
[root@localhost ~]# vi scale-out.yaml
pump_servers:
- host: 192.168.1.118
ssh_port: 22
port: 8250
deploy_dir: "/tidb-deploy/pump-8250"
data_dir: "/tidb-data/pump-8250"
# The following configs are used to overwrite the `server_configs.pump` values.
config:
gc: 7
- host: 192.168.1.85
ssh_port: 22
port: 8250
deploy_dir: "/tidb-deploy/pump-8250"
data_dir: "/tidb-data/pump-8250"
# The following configs are used to overwrite the `server_configs.pump` values.
config:
gc: 7
- host: 192.168.1.134
ssh_port: 22
port: 8250
deploy_dir: "/tidb-deploy/pump-8250"
data_dir: "/tidb-data/pump-8250"
# The following configs are used to overwrite the `server_configs.pump` values.
config:
gc: 7
2.解压toolkit安装包
6.0之后pump安装文件单独放到了toolkit安装包里面了
[root@localhost tidb]#tar -xvf tidb-community-toolkit-v6.0.0-linux-amd64.tar.gz
[root@localhost tidb]# cd tidb-community-toolkit-v6.0.0-linux-amd64
[root@localhost tidb-community-toolkit-v6.0.0-linux-amd64]# sh local_install.sh
Disable telemetry success
Successfully set mirror to /soft/tidb/tidb-community-toolkit-v6.0.0-linux-amd64
Detected shell: bash
Shell profile: /root/.bash_profile
Installed path: /root/.tiup/bin/tiup
===============================================
1. source /root/.bash_profile
2. Have a try: tiup playground
===============================================
查看安装镜像文件
[root@localhost tidb-community-toolkit-v6.0.0-linux-amd64]# tiup mirror show
/soft/tidb/tidb-community-toolkit-v6.0.0-linux-amd64
3.合并镜像
安装包合并merge
[root@localhost tidb-community-toolkit-v6.0.0-linux-amd64]# cp -r /soft/tidb/tidb-community-server-v6.0.0-linux-amd64/keys /root/.tiup/
[root@localhost tidb-community-toolkit-v6.0.0-linux-amd64]# cp -r /soft/tidb/tidb-community-toolkit-v6.0.0-linux-amd64/keys /root/.tiup/
[root@localhost tidb-community-toolkit-v6.0.0-linux-amd64]# tiup mirror merge /soft/tidb/tidb-community-server-v6.0.0-linux-amd64 /soft/tidb/tidb-community-toolkit-v6.0.0-linux-amd64
4.执行扩容命令
执行 scale-out 命令前,先使用 check 及 check --apply 命令,检查和自动修复集群存在的潜在风险:
(1)检查集群存在的潜在风险:
[root@localhost tmp]#tiup cluster check mytidb_cluster /tmp/scale-out.yaml --cluster --user root
(2)自动修复集群存在的潜在风险:
[root@localhost tmp]#tiup cluster check mytidb_cluster /tmp/scale-out.yaml --cluster --apply --user root
(3)执行 scale-out 命令扩容 TiDB 集群:
[root@localhost tmp]#tiup cluster scale-out mytidb_cluster /tmp/scale-out.yaml
5.查看集群状态
tiup cluster display mytidb_cluster