如何在客户端重置Canal的位置?
问题描述:
现在的位点在远程Canal所监听的mysql binlog时间长了已经删了。 message message.getId()为永远为-1。 message.getEntries().size() 永远为 0,永远读不出数据!!
疑问:
请问如何在不改动 远程Canal服务的配置或其他啊哦做的情况下,客户端自己重置位置为最新的? 就是监听最新的binlog消息,之前的binlog就忽略???
Canal 服务destination配置
canal.instance.mysql.slaveId = 617
canal.instance.master.address = 10.1.6.226:3307 canal.instance.master.journal.name = canal.instance.master.position = canal.instance.master.timestamp =
#canal.instance.standby.address = #canal.instance.standby.journal.name = #canal.instance.standby.position = #canal.instance.standby.timestamp =
canal.instance.dbUsername = mescanal canal.instance.dbPassword = mescanal canal.instance.defaultDatabaseName = canal.instance.connectionCharset = UTF-8
canal.instance.filter.regex = .\..
canal.instance.filter.black.regex =
meta.data
cat meta.dat {"clientDatas":[{"clientIdentity":{"clientId":1001,"destination":"mysql_b7_gaotaiunyue","filter":".\.."},"cursor":{"identity":{"slaveId":-1,"sourceAddress":{"address":"10.1.6.226","port":3307}},"postion":{"included":false,"journalName":"my3307-bin.000303","position":77593731,"serverId":3307,"timestamp":1521010166000}}}],"destination":"mysql_b7_gaotaiunyue"}
这是日志代码
2018-03-22 10:41:54.051 [destination = mysql_b7_gaotianyue , address = /10.1.6.226:3307 , EventParser] ERROR c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - dump address /10.1.6.226:3307 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:95) ~[canal.parse-1.0.22.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:113) ~[canal.parse-1.0.22.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:210) ~[canal.parse-1.0.22.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65] 2018-03-22 10:41:54.051 [destination = mysql_b7_gaotianyue , address = /10.1.6.226:3307 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:mysql_b7_liupengchun[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:95) at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:113) at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:210) at java.lang.Thread.run(Thread.java:745)
原提问者GitHub用户WilliamGai
Could not find first log file name in binary log index file,位点不存在
如果是阿里云这类rds的情况(一个vip挂后端主备),会自动重新定位,其余的mysql情况,因为binlog被删除,即使重新定位也没用
参考FAQ : https://github.com/alibaba/canal/wiki/FAQ
原回答者GitHub用户agapple
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。