Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: ticdc 无法同步数据到下游数据库
[TiDB Usage Environment] Production Environment / Testing / Poc
[TiDB Version] v6.1.0
[Reproduction Path]
- Use ticdc to synchronize data to the downstream TiDB;
- Status of the source database:
The red box indicates the cdc node used. - Table structure for synchronization:
CREATE TABLE `ads_test_pushuo_file` (
`crticle_content_id` bigint(20) NOT NULL,
`filename` varchar(100) NOT NULL,
`content` text DEFAULT NULL,
PRIMARY KEY (`crticle_content_id`) /*T![clustered_index] NONCLUSTERED */,
UNIQUE KEY `primary_index` (`crticle_content_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
- Synchronization command
Enter the server of the node 172.16.2.3:8300 and run the command:
/data-tidb/tidb-deploy/ticdc-8300/bin/cdc cli changefeed create --pd=http://172.16.2.13:2379 --sink-uri="tidb://root:playlist6@172.1.1.12:4000/" --changefeed-id="ads-test-file" --config kmxxg_content_security.toml
- Configuration file:
case-sensitive = true
enable-old-value = true
[filter]
rules = ['kmxxg_content_security.ads_test_pushuo_file']
[mounter]
worker-num = 16
[sink]
protocol = "default"
[cyclic-replication]
enable = false
replica-id = 1
filter-replica-ids = [2,3]
sync-ddl = true
- Check the cdc task status:
- Check the detailed cdc task:
{
"info": {
"upstream-id": 0,
"sink-uri": "tidb://root:playlist6@172.1.1.12:4000/",
"opts": {},
"create-time": "2022-12-13T14:45:10.378326772+08:00",
"start-ts": 438020056014913540,
"target-ts": 0,
"admin-job-type": 0,
"sort-engine": "unified",
"sort-dir": "",
"config": {
"case-sensitive": true,
"enable-old-value": true,
"force-replicate": false,
"check-gc-safe-point": true,
"filter": {
"rules": [
"kmxxg_content_security.ads_test_pushuo_file"
],
"ignore-txn-start-ts": null
},
"mounter": {
"worker-num": 16
},
"sink": {
"dispatchers": null,
"protocol": "default",
"column-selectors": null,
"schema-registry": ""
},
"cyclic-replication": {
"enable": false,
"replica-id": 1,
"filter-replica-ids": [
2,
3
],
"id-buckets": 0,
"sync-ddl": true
},
"consistent": {
"level": "none",
"max-log-size": 64,
"flush-interval": 1000,
"storage": ""
}
},
"state": "normal",
"error": null,
"sync-point-enabled": false,
"sync-point-interval": 600000000000,
"creator-version": "v6.1.0"
},
"status": {
"resolved-ts": 438062843066580994,
"checkpoint-ts": 438062843066580994,
"admin-job-type": 0
},
"count": 0,
"task-status": []
}
[Encountered Problem: Problem Phenomenon and Impact]
- Insert data into the source database’s ads_test_pushuo_file;
- Check the target database’s ads_test_pushuo_file, no data has been added;
Could you please identify where the synchronization issue might be based on the configuration?
[Resource Configuration]
[Attachments: Screenshots/Logs/Monitoring]