开发者社区> 问答> 正文

otter同步报错Timeout occurred, failed to read 4 bytes

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

展开
收起
古拉古拉 2023-06-16 19:57:10 294 0
1 条回答
写回答
取消 提交回答
  • 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

    2023-06-16 20:14:02
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载