2018-12-06 03:00:57.042 [destination = online_mryt_tms_canal , address = /ip:3306 , EventParser] ERROR c.a.o.canal.parse.inbound.mysql.dbsync.DirectLogFetcher - Socket timeout expired, closing connection java.net.SocketTimeoutException: Timeout occurred, failed to read 4 bytes in 25000 milliseconds. at com.alibaba.otter.canal.parse.driver.mysql.socket.BioSocketChannel.read(BioSocketChannel.java:123) ~[canal.parse.driver-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch0(DirectLogFetcher.java:174) ~[canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:77) ~[canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:154) [canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:266) [canal.parse-1.1.1.jar:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131] 2018-12-06 03:00:57.049 [destination = online_mryt_tms_canal , address = /ip:3306 , EventParser] ERROR c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - dump address ip/1 0.13.11.122:3306 has an error, retrying. caused by java.net.SocketTimeoutException: Timeout occurred, failed to read 4 bytes in 25000 milliseconds. at com.alibaba.otter.canal.parse.driver.mysql.socket.BioSocketChannel.read(BioSocketChannel.java:123) ~[canal.parse.driver-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch0(DirectLogFetcher.java:174) ~[canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:77) ~[canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:154) ~[canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:266) ~[canal.parse-1.1.1.jar:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131] 2018-12-06 03:00:57.049 [destination = online_mryt_tms_canal , address = /ip:3306 , EventParser] WARN c.a.o.s.a.i.setl.zookeeper.termin.WarningTerminProcess - nid:4[2:canal:online_mryt _tms_canal:java.net.SocketTimeoutException: Timeout occurred, failed to read 4 bytes in 25000 milliseconds. at com.alibaba.otter.canal.parse.driver.mysql.socket.BioSocketChannel.read(BioSocketChannel.java:123) at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch0(DirectLogFetcher.java:174) at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:77) at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:154) at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:266) at java.lang.Thread.run(Thread.java:748) ] 2018-12-06 03:01:09.095 [destination = online_mryt_tms_canal , address = /ip:3306 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - prepare to find start posit ion just last position {"identity":{"slaveId":-1,"sourceAddress":{"address":"ip","port":3306}},"postion":{"gtid":"","included":false,"journalName":"mysql-bin.000172","position":619737365,"serverId":96029,"ti mestamp":1544036431000}} 2018-12-06 03:01:09.095 [destination = online_mryt_tms_canal , address = /ip:3306 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - find start position : Entry Position[included=false,journalName=mysql-bin.000172,position=619737365,serverId=96029,gtid=,timestamp=1544036431000] 2018-12-06 03:01:09.100 [destination = online_mryt_tms_canal , address = /ip:3306 , EventParser] ERROR c.a.o.canal.parse.inbound.mysql.dbsync.DirectLogFetcher - I/O error while reading from client socket java.io.IOException: Received error packet: errno = 1236, sqlstate = HY000 errmsg = Could not find first log file name in binary log index file at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102) ~[canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:154) [canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:266) [canal.parse-1.1.1.jar:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131] 2018-12-06 03:01:09.100 [destination = online_mryt_tms_canal , address = /ip:3306 , EventParser] ERROR c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - dump address ip/1 0.13.11.122:3306 has an error, retrying. caused by java.io.IOException: Received error packet: errno = 1236, sqlstate = HY000 errmsg = Could not find first log file name in binary log index file at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.DirectLogFetcher.fetch(DirectLogFetcher.java:102) ~[canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:154) ~[canal.parse-1.1.1.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:266) ~[canal.parse-1.1.1.jar:na] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
原提问者GitHub用户zk19930911
Could not find first log file name in binary log index file 阿里的MYSQL-RDS不会持久化所有的binlog日志,当遇到异常时,先前的binlog日志会丢失,此时otter恢复时,但otter记录的binlog位点仍然是之前那个,此时就对不上了。
解决方案: 1.粗暴点。首先清空cannel里的位点信息(如果你设置了的话,直接置空),然后cannel 中pipeline里的binlog位点,直接删掉当前记录的位点信息(需要先停掉pipeline),重启pipeline,大约1min左右恢复。如果不行,多来几次 2.精确定位。先停掉pipeline,删掉位点信息;在数据库了找到当前位点【SELECT UNIX_TIMESTAMP(); SHOW MASTER STATUS;】,设置cannel的binlog信息(按照格式来),重启pipeline,解决
原回答者GitHub用户funyule
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。