環境:tidb4.0.8、centos7.6
1、tidb擴容ticdc
1. 添加節點信息到 scale-out.yaml 文件
cdc_servers: - host: 172.168.20.51 port: 8300 deploy_dir: "/data1/tidb-deploy/cdc-8300" log_dir: "/data1/tidb-deploy/cdc-8300/log"
2、運行擴容命令
tiup cluster scale-out tidb scale-out.yaml
2、ticdc創建kafka同步任務
tiup cdc cli changefeed create --pd=http://172.168.20.49:2379 --sink-uri="kafka://127.0.0.1:9092/cdc-test?kafka-version=2.4.0&partition-num=6&max-message-bytes=67108864&replication-factor=1" Create changefeed successfully! ID: simple-replication-task
3、常用命令
查詢同步任務列表: tiup cdc cli changefeed list --pd=http://172.168.20.49:2379 停止同步任務: tiup cdc cli changefeed pause --pd=http://172.168.20.49:2379 --changefeed-id simple-replication-task 以上命令中: --changefeed-id=uuid 為需要操作的 changefeed ID。 恢復同步任務: tiup cdc cli changefeed resume --pd=http://172.168.20.49:2379 --changefeed-id simple-replication-task 刪除同步任務: tiup cdc cli changefeed remove --pd=http://172.168.20.49:2379 --changefeed-id simple-replication-task 刪除任務后會保留任務的同步狀態信息 24 小時(主要用於記錄同步的 checkpoint),24 小時內不能創建同名的任務。如果希望徹底刪除任務信息,可以指定 --force 或 -f 參數刪除,刪除后 changefeed 的所有信息都會被清理,可以立即創建同名的 changefeed。 tiup cdc cli changefeed remove --pd=http://172.168.20.49:2379 --changefeed-id