项目中,遇到的Canal异常如下:
2021-07-14 09:57:30.501 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnecti
on to /localhost:3306...
2021-07-14 09:57:30.549 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - handshake initializat
ion packet received, prepare the client authentication packet to send
2021-07-14 09:57:30.549 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - client authentication
packet is sent out.
2021-07-14 09:57:30.597 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - auth switch response
packet is sent out.
2021-07-14 09:57:31.076 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.a.otter.canal.parse.inbound.mysql.MysqlConnection - Register slave RegisterSl
aveCommandPacket[reportHost=192.168.1.80,reportPort=40858,reportUser=case,reportPasswd=password,serverId=1560281089,command=21]
2021-07-14 09:57:31.124 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.a.otter.canal.parse.inbound.mysql.MysqlConnection - COM_BINLOG_DUMP with posi
tion:BinlogDumpCommandPacket[binlogPosition=4,slaveServerId=1560281089,binlogFileName=binlog.000022,command=18]
2021-07-14 09:57:31.196 [pool-4-thread-2] INFO c.a.otter.canal.server.embedded.CanalServerWithEmbedded - getWithoutAck successfully, clientId:1001 batchSize:50 real size is 15 and result is
[batchId:1 , position:PositionRange[start=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,posit
ion=227,serverId=1,gtid=,timestamp=1626066389000]],ack=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.
000022,position=12561,serverId=1,gtid=,timestamp=1626066755000]],end=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journ
alName=binlog.000022,position=12561,serverId=1,gtid=,timestamp=1626066755000]],endSeq=14]]
2021-07-14 09:57:31.197 [pool-4-thread-2] INFO c.a.otter.canal.server.embedded.CanalServerWithEmbedded - ack successfully, clientId:1001 batchId:1 position:PositionRange[start=LogPosition[id
entity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=227,serverId=1,gtid=,timestamp=1626066389000]],ack=Lo
gPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=12561,serverId=1,gtid=,timestamp=16260667
55000]],end=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=12561,serverId=1,gtid=,time
stamp=1626066755000]],endSeq=14]
2021-07-14 09:57:31.298 [pool-4-thread-2] INFO c.a.otter.canal.server.embedded.CanalServerWithEmbedded - getWithoutAck successfully, clientId:1001 batchSize:50 real size is 81 and result is
[batchId:2 , position:PositionRange[start=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,posit
ion=13685,serverId=1,gtid=,timestamp=1626066777000]],ack=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlo
g.000022,position=70920,serverId=1,gtid=,timestamp=1626068949000]],end=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,jou
rnalName=binlog.000022,position=70920,serverId=1,gtid=,timestamp=1626068949000]],endSeq=95]]
2021-07-14 09:57:31.325 [destination = canal-staging-test , address = /localhost:3306 , EventParser] ERROR c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - dump address /120.25.22
5.226:3306 has an error, retrying. caused by
com.alibaba.otter.canal.parse.exception.CanalParseException: com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed.
Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed.
Caused by: java.lang.IllegalArgumentException: limit excceed: 369
at com.taobao.tddl.dbsync.binlog.LogBuffer.getUint8(LogBuffer.java:235)
at com.taobao.tddl.dbsync.binlog.LogBuffer.getPackedLong(LogBuffer.java:1024)
at com.taobao.tddl.dbsync.binlog.JsonDiffConversion.print_json_diff(JsonDiffConversion.java:48)
at com.taobao.tddl.dbsync.binlog.event.RowsLogBuffer.fetchValue(RowsLogBuffer.java:1073)
at com.taobao.tddl.dbsync.binlog.event.RowsLogBuffer.nextValue(RowsLogBuffer.java:125)
at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.LogEventConvert.parseOneRow(LogEventConvert.java:726)
at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.LogEventConvert.parseRowsEvent(LogEventConvert.java:549)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor$DmlParserStage.onEvent(MysqlMultiStageCoprocessor.java:330)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlMultiStageCoprocessor$DmlParserStage.onEvent(MysqlMultiStageCoprocessor.java:316)
at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:143)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2021-07-14 09:57:31.326 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - disConnect MysqlConne
ction to /localhost:3306...
2021-07-14 09:57:31.326 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - disConnect MysqlConne
ction to /localhost:3306...
2021-07-14 09:57:31.365 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnecti
on to /localhost:3306...
2021-07-14 09:57:31.404 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - handshake initializat
ion packet received, prepare the client authentication packet to send
2021-07-14 09:57:31.404 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - client authentication
packet is sent out.
2021-07-14 09:57:31.440 [pool-4-thread-2] INFO c.a.otter.canal.server.embedded.CanalServerWithEmbedded - ack successfully, clientId:1001 batchId:2 position:PositionRange[start=LogPosition[id
entity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=13685,serverId=1,gtid=,timestamp=1626066777000]],ack=
LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=70920,serverId=1,gtid=,timestamp=162606
8949000]],end=LogPosition[identity=LogIdentity[sourceAddress=/localhost:3306,slaveId=-1],postion=EntryPosition[included=false,journalName=binlog.000022,position=70920,serverId=1,gtid=,ti
mestamp=1626068949000]],endSeq=95]
2021-07-14 09:57:31.443 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - auth switch response
packet is sent out.
2021-07-14 09:57:31.521 [destination = canal-staging-test , address = /localhost:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - KILL DUMP 358092 fail
ure
java.io.IOException: ErrorPacket [errorNumber=1094, fieldCount=-1, message=Unknown thread id: 358092, sqlState=HY000, sqlStateMarker=#]
with command: KILL CONNECTION 358092
at com.alibaba.otter.canal.parse.driver.mysql.MysqlUpdateExecutor.update(MysqlUpdateExecutor.java:49)
at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.disconnect(MysqlConnector.java:113)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.disconnect(MysqlConnection.java:97)
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:315)
at java.lang.Thread.run(Thread.java:748)
分析:mysql系统表权限较高,canal读该表的binlog失败,位点无法移动
解决:将配置项中黑名单加上mysql下的所有表:canal.instance.filter.black.regex = mysql\\..* ,修改后canal集群不需要重启即可恢复;