tidb的组件ticdc传输数据到kafka

环境: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 

  

  

  

  

posted @ 2021-09-15 15:24  苍茫宇宙  阅读(589)  评论(0编辑  收藏  举报