现象
????????在instances配置指定binlog消费时,没指定binlog文件时,如只指定了起始消费时间,出现了读取异常。
# binlog的pos位点信息
canal.instance.master.address=10.2.55.55:3306
#mysql起始的binlog文件
canal.instance.master.journal.name=
#mysql起始的binlog偏移量
canal.instance.master.position=
#mysql起始的binlog时间戳
canal.instance.master.timestamp= 1650533700000
#mysql起始的binlog的gtid
canal.instance.master.gtid=
ERROR c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - dump address /10.2.55.55:3306 has an error, retrying. caused by
com.alibaba.otter.canal.parse.exception.CanalParseException: command : 'show binlog events limit 1' has an error!
Caused by: java.io.IOException: EOF encountered.
at com.alibaba.otter.canal.parse.driver.mysql.socket.BioSocketChannel.read(BioSocketChannel.java:56) ~[canal.parse.driver-1.1.5.jar:na]
at com.alibaba.otter.canal.parse.driver.mysql.utils.PacketManager.readHeader(PacketManager.java:13) ~[canal.parse.driver-1.1.5.jar:na]
at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.readNextPacket(MysqlQueryExecutor.java:159) ~[canal.parse.driver-1.1.5.jar:na]
at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.query(MysqlQueryExecutor.java:78) ~[canal.parse.driver-1.1.5.jar:na]
错误原因
? ? ? ? 当只canal没有配置canal.instance.master.journal.name时,canal会从mysql的mybinlog.index表中依次获取binlog文件名,正常情况文件名和文件都是对应的。
? ? ? ? 我这里因为binlog文件太大,手动删除了binlog文件,导致mybinlog.index和binlog文件不一致,没有找到对应的binlog文件。
?修复方案
修改binlog.index索引文件与实际的binglog文件一致即可。
|