1.编辑binlog拓扑文件
vi scale-out-binlog.yaml
pump_servers:
- host: 172.31.0.49
drainer_servers:
- host: 172.31.0.60
config:
syncer.db-type: "mysql"
syncer.to.host: "172.31.0.49"
syncer.to.user: "root"
syncer.to.password: "mysql"
syncer.to.port: 3306
下游创建权限用户(drainer到mysql的用户权限):
mysql> create user 'root'@'172.31.0.135' idenfitide by 'mysql';
mysql> grant all privileges on *.* to 'root'@'172.31.0.135';
初始需要自己同步,binlog不支持全量复制,用br或者其他工具,然后tidb binlog
个人见解:
先自己br同步,然后指定tso进行应用。
2.扩容组件
安装
tiup cluster scale-out tidb-haha scale-out-binlog.yaml -uroot -p
查看状态
tiup cluster display tidb-haha
3.查看binlog
查看tidb binlog是否开启
mysql> show variables like 'log_bin';
修改参数
tiup cluster edit-config tidb-haha
参数见下方
reload
tiup cluster reload tidb-test
再次查看binlog
mysql> show variables like 'log_bin';
4.使用binlogctl
1.下载包(https://docs.pingcap.com/zh/tidb/v6.1/download-ecosystem-tools),解压
获取:
wget https://download.pingcap.org/tidb-community-toolkit-v6.1.0-linux-amd64.tar.gz
解压tar xvf xxxxxxxx
2.进入路径,查看,包含(dumpling、lightning、cdc、dm、spark等等)
3.设置环境变量