anjing
(Anjing)
1
【TiDB 版本】
v4.0.7
【问题描述】
ticdc 可以成功创建同步到mysql的任务,但是下游mysql没有数据同步,创建任务也没有报错
任务详情
也没错误日志,MySQL没有任何数据
toml文件
case-sensitive = true
# 是否输出 old value,从 v4.0.5 开始支持
enable-old-value = true
[filter]
# 忽略指定 start_ts 的事务
ignore-txn-start-ts = [1, 2]
# 过滤器规则
# 过滤规则语法:https://docs.pingcap.com/zh/tidb/stable/table-filter#表库过滤语法
# test.* a.* 只推送test,a 数据库的所有表
rules = [
'bluelans_pt.*'
]
[mounter]
# mounter 线程数,用于解码 TiKV 输出的数据
worker-num = 16
[sink]
dispatchers = [
{matcher = [
]},
# {matcher = ['bluelans_pt_cron.*', 'bluelans_pt_log.*','bluelans_pt_wish.*']},
]
# 对于 MQ 类的 Sink,可以指定消息的协议格式
# 目前支持 default、canal、avro 和 maxwell 四种协议。default 为 TiCDC Open Protocol
#protocol = "canal" #不友好,数据格式难以解析
#protocol = "default" #不友好,无时无刻在推送
#protocol = "avro" #需要注册
protocol = "maxwell"
[cyclic-replication]
# 是否开启环形同步
enable = false
# 当前 TiCDC 的复制 ID
replica-id = 1
# 需要过滤掉的同步 ID
filter-replica-ids = [2,3]
# 是否同步 DDL
sync-ddl = true
anjing
(Anjing)
3
-
cdc_query.txt (218.5 KB)
- 少部分表没有有效索引,绝大部分表都有有效索引,一条数据都没有同步
3.cdc启动日志
cdc_stderr.log (5.1 KB)
找一张有有效索引的表,单独同步这张表试试看,能不能同步数据。
anjing
(Anjing)
5
同步一张表也没有数据
Starting component `ctl`: /home/tidb/.tiup/components/ctl/v4.0.7/ctl cdc changefeed query --pd=http://192.168.88.43:2379 --changefeed-id=mysql-bluelans-pt
{
"info": {
"sink-uri": "mysql://root:test@192.168.88.234:3306/",
"opts": {},
"create-time": "2021-04-07T11:23:32.631091914+08:00",
"start-ts": 424087601186603084,
"target-ts": 0,
"admin-job-type": 0,
"sort-engine": "memory",
"sort-dir": ".",
"config": {
"case-sensitive": true,
"enable-old-value": true,
"filter": {
"rules": [
"bluelans_pt.pt_ebay_whitelist_word"
],
"ignore-txn-start-ts": [
1,
2
],
"ddl-allow-list": null
},
"mounter": {
"worker-num": 16
},
"sink": {
"dispatchers": [
{
"matcher": [],
"dispatcher": ""
}
],
"protocol": "maxwell"
},
"cyclic-replication": {
"enable": false,
"replica-id": 1,
"filter-replica-ids": [
2,
3
],
"id-buckets": 0,
"sync-ddl": true
},
"scheduler": {
"type": "table-number",
"polling-time": -1
}
},
"state": "normal",
"history": null,
"error": null
},
"status": {
"resolved-ts": 424087637349367996,
"checkpoint-ts": 424087637349367996,
"admin-job-type": 0
},
"count": 0,
"task-status": [
{
"capture-id": "ba493b30-2b1b-4e5b-95ca-513fc6f33a85",
"status": {
"tables": {
"4684": {
"start-ts": 424087601186603084,
"mark-table-id": 0
}
},
"operation": null,
"admin-job-type": 0
}
}
]
}
拿一下 cdc.log 看下,不是 cdc_stderr.log
anjing
(Anjing)
8
测试同步一张表有数据了
同步整个库一条数据都没有,不是延迟的问题,任务开启过了一个晚上都没有数据
整个库680多个表
同步一张表有数据了,是做了什么操作么?还是说等了一会就有了?
如果同步单个表示可以的,同步整个库没有数据同步,那应该是没有有效索引的表影响了整体同步,可以考虑将没有有效索引的表过滤一下。
anjing
(Anjing)
10
没有做其他操作,单个表可以同步,整个库没有数据同步
在刚刚测试同步成功后不久,集群突然挂了,最开始是一个cdc和3个pd挂了,全部停止后就启动不了
这是另一个帖
yilong
(yi888long)
11
另一个帖子中集群应该恢复了,可以继续看看是否还有这个问题,多谢。
system
(system)
关闭
12
此话题已在最后回复的 1 分钟后被自动关闭。不再允许新回复。