开发者社区> 问答> 正文

如何在客户端重置Canal的位置?现在的位点在远程Canal所监听的mysql binlog时间长了

如何在客户端重置Canal的位置?

问题描述:

现在的位点在远程Canal所监听的mysql binlog时间长了已经删了。 message message.getId()为永远为-1。 message.getEntries().size() 永远为 0,永远读不出数据!!

疑问:

请问如何在不改动 远程Canal服务的配置或其他啊哦做的情况下,客户端自己重置位置为最新的? 就是监听最新的binlog消息,之前的binlog就忽略???

Canal 服务destination配置

canal.instance.mysql.slaveId = 617

position info

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 =

username/password

canal.instance.dbUsername = mescanal canal.instance.dbPassword = mescanal canal.instance.defaultDatabaseName = canal.instance.connectionCharset = UTF-8

table regex

canal.instance.filter.regex = .\..

table black 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

展开
收起
绿子直子 2023-05-09 10:42:57 148 0
1 条回答
写回答
取消 提交回答
  • 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

    2023-05-10 10:15:17
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
百问百答-RDS (上) 立即下载
MySQL 技术大全:开发、优化与运维实战 立即下载
PolarDB-X 2.0 全局 Binlog 与备份恢复能 立即下载

相关镜像