canal 启动遇到error while reading fr
2022-02-18 本文已影响0人
WMSmile
canal 启动遇到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的问题
canal server 对应的是 canal-deployer
使用 tail -f canal_server/logs/example/example.log
或者 vi canal_server/logs/example/example.log
2022-02-18 02:09:30.403 [destination = example , address = /127.0.0.1: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.5.jar:na]
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:238) [canal.parse-1.1.5.jar:na]
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262) [canal.parse-1.1.5.jar:na]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_312]
2022-02-18 02:09:30.403 [destination = example , address = /127.0.0.1:3306 , EventParser] ERROR c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - dump address /127.0.0.1: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.5.jar:na]
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:238) ~[canal.parse-1.1.5.jar:na]
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262) ~[canal.parse-1.1.5.jar:na]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_312]
2022-02-18 02:09:30.403 [destination = example , address = /127.0.0.1:3306 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:example[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)
at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:238)
at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$1.run(AbstractEventParser.java:262)
at java.lang.Thread.run(Thread.java:748)
]
解决办法如下:
实例目录下有三个文件
ubuntu03@ubuntu03:~/canal_server/conf/example$ ls -l
total 140
-rw-rw-r-- 1 ubuntu03 ubuntu03 135168 Feb 18 02:11 h2.mv.db
-rw-rw-r-- 1 ubuntu03 ubuntu03 135168 Feb 18 02:11 meta.dat
-rwxrwxr-x 1 ubuntu03 ubuntu03 2106 Feb 17 11:12 instance.properties
删除 h2.mv.db 和 meta.dat就可以了.
rm -rf canal_server/conf/example/h2.mv.db
rm -rf canal_server/conf/example/meta.dat
重启canal-server(canal-deployer)
sh canal_server/bin/restart.sh