TiDB

TiCDC #

/root/.tiup/bin/

tiup cluster restart tidb-syh-test -R cdc

tiup cluster restart dzzz_test -R cdc

capture б #


cdc cli capture list --pd=http://172.17.3.88:2379

ͬ #

cdc cli changefeed create --pd=http://172.17.3.88:2379 --sink-uri="kafka://172.17.3.138:9092/tidb-cert-topic?protocol=open-protocol&kafka-version=2.7.0&partition-num=3&max-message-bytes=67108864&replication-factor=1" --changefeed-id="kafka-cert-task" --sort-engine="unified"

./bin/cdc cli changefeed create –pd=http://172.22.1.149:2379 –sink-uri="rocket://10.210.82.115:18082/test?protocol=canal-json” –changefeed-id="rocket-test” –sort-engine="unified”

sd test #

./bin/cdc cli changefeed create –pd=http://10.210.82.201:2379 –sink-uri="rocket://10.210.82.110:18082/cert-data?tag=cdc&accessKey=rocketmq2&secretKey=7LBrygK7&protocol=canal-json” –changefeed-id="rocketmq” –sort-engine="unified” –config conf/filter.toml

./bin/cdc cli changefeed create –pd=http://10.210.82.201:2379 –sink-uri="mysql://quanmin110:Q9iMipDsX@10.210.82.116:4000/?worker-count=2&max-txn-row=500” –changefeed-id="task-tidb201-to-tidb116” –sort-engine="unified” –config /root/tidb6.5.0/migrate_to_tidb_ticdc_config.toml

./bin/cdc cli changefeed list –pd=http://10.210.82.201:2379

test2

./bin/cdc cli changefeed create –pd=http://10.210.82.113:2379 –sink-uri="rocket://10.210.82.110:18082/cert-data?tag=cdc&accessKey=rocketmq2&secretKey=7LBrygK7&protocol=canal-json” –changefeed-id="rocketmq-test” –sort-engine="unified” –config conf/filter.toml

./bin/cdc cli changefeed create –pd=http://172.22.1.149:2379 –sink-uri="file:///tmp/cdc-test?protocol=canal-json” –changefeed-id="file-task” –sort-engine="unified” –config conf/filter.toml

cdc changefeed create –pd=http://10.210.82.201:2379 –sink-uri="mysql://quanmin110:Q9iMipDsX@10.210.82.116:4000/?worker-count=2&max-txn-row=500” –changefeed-id="task-tidb201-to-tidb116” –sort-engine="unified” –start-ts=443639383842881543 –config /root/tidb6.5.0/migrate_to_tidb_ticdc_config.toml

blackhole://

./bin/cdc cli changefeed list –pd=http://172.22.1.149:2379

./bin/cdc cli changefeed list –pd=http://10.210.82.113:2379

./bin/cdc cli changefeed remove -c rocket-test –pd=http://10.210.82.113:2379

鿴״̬ #

cdc cli changefeed list --pd=http://172.17.3.88:2379 

[admin@v082022 cdc-8300]$ ./bin/cdc cli changefeed list –pd=http://10.210.82.201:2379 [ { “id”: “task-tidb201-to-tidb116”, “namespace”: “default”, “summary”: { “state”: “stopped”, “tso”: 448214620309028865, “checkpoint”: “2024-03-07 17:18:06.506”, “error”: { “addr”: “10.210.82.21:8300”, “code”: “CDC:ErrReachMaxTry”, “message”: “[CDC:ErrReachMaxTry]reach maximum try: 8, error: [CDC:ErrMySQLTxnError]MySQL txn error: Error 1062: Duplicate entry ‘37030013034516-91370303MA3TAH499C-11100000000013127D020-11370300’ for key ‘cert_error_record.uniq_key’: [CDC:ErrMySQLTxnError]MySQL txn error: Error 1062: Duplicate entry ‘37030013034516-91370303MA3TAH499C-11100000000013127D020-11370300’ for key ‘cert_error_record.uniq_key’” } } } ]

[admin@v082022 cdc-8300]$ ./bin/cdc cli changefeed list –pd=http://10.210.82.10:2379 [ { “id”: “task-tidb201-to-tidb116”, “namespace”: “default”, “summary”: { “state”: “normal”, “tso”: 448215859242205196, “checkpoint”: “2024-03-07 18:36:52.661”, “error”: null } } ]

TiDB-CDC ʵʱͬ

1رtidb GC SELECT @@global.tidb_gc_enable; SET GLOBAL tidb_gc_enable=false; SELECT @@global.tidb_gc_enable;

1ݿ⣬10.210.82.1ִ time mydumper -u root -p quanmin110.com -h 127.0.0.1 -P 4000 -t 10 –regex ‘^(?!(certfront|perdatabase|mysql|test|dm_meta|INFORMATION_SCHEMA|METRICS_SCHEMA|PERFORMANCE_SCHEMA))’ “tidb_distsql_scan_concurrency=10,tidb_mem_quota_query=8589934592” -o /data/admin/201 2ָݣ10.210.82.116ִ time loader -u root -p ‘y4riN8J$S-Z%=1295c’ -h 127.0.0.1 -P 4000 -t 10 -d /data/admin/201 3cdcʵʱͬϵݣ10.210.82.116ִ tiup ctl:v6.5.0 cdc changefeed create –pd=http://10.210.82.201:2379 –sink-uri="mysql://quanmin110:Q9iMipDsX@10.210.82.116:4000/?worker-count=2&max-txn-row=500” –changefeed-id="task-tidb201-to-tidb116” –sort-engine="unified” –start-ts=443639383842881543 –config /root/tidb6.5.0/migrate_to_tidb_ticdc_config.toml

10.210.82.21 ͨcdcִ /data/admin/tidb/tidb-deploy/cdc-8300/bin/cdc cli changefeed create –pd=http://10.210.82.201:2379 –sink-uri="mysql://quanmin110:Q9iMipDsX@10.210.82.116:4000/?worker-count=2&max-txn-row=500” –changefeed-id="task-tidb201-to-tidb116” –sort-engine="unified” –config /root/migrate_to_tidb_ticdc_config.toml

#(MySQL/TiDB) #worker-count: ִSQLIJ(ѡĬֵΪ16) #max-txn-row: ִSQLbathСѡĬֵΪ256

4鿴ضͬ tiup ctl:v6.5.0 cdc changefeed query -s –pd=http://10.210.82.201:2379 –changefeed-id=task-tidb201-to-tidb116

5鿴 tiup ctl:v6.5.0 cdc changefeed query –pd=http://10.210.82.201:2379 –changefeed-id=task-tidb201-to-tidb116

6ѯTiCDCͬ tiup ctl:v6.5.0 cdc changefeed list –pd=http://10.210.82.201:2379 –changefeed-id=task-tidb201-to-tidb116

7ͣ tiup ctl:v6.5.0 cdc changefeed pause –pd=http://http://10.210.82.201:2379 –changefeed-id=ask-tidb201-to-tidb116

6ѯTiCDCͬ tiup ctl:v6.5.0 cdc changefeed resume –pd=http://10.210.82.201:2379 –changefeed-id=task-tidb201-to-tidb116

ɾͬ tiup ctl:v6.5.0 cdc changefeed remove –pd=http://http://10.210.82.201:2379 –changefeed-id=ask-tidb201-to-tidb116

7¿ GC SELECT @@global.tidb_gc_enable; SET GLOBAL tidb_gc_enable=TRUE; SELECT @@global.tidb_gc_enable;

#

time loader -u hewenwei -p Hew -h 10.210.82.116 -P 33106 -t 10 -d /data/admin/201 time loader -u root -p ‘y4riN8J$S-Z%=1295c’ -h 127.0.0.1 -P 4000 -t 30 -d /data/admin/201-1

8ɾ tiup ctl:v6.5.0 cdc changefeed remove –pd=http://10.210.82.201:2379 –changefeed-id kafka-cert-task