HA模式下,canal.instance.tsdb.enable=true,数据库进行主从切换后,canal的master与standby 切换后,会报如下异常。目前我使用的解决方式是将canal.instance.tsdb.enable=false,就可以进行正常的切换了。
2018-08-07 10:44:48.772 [destination = orderfailover , address = /10.8.132.135:3306 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - prepare to find start position by switch ::1532919362000 2018-08-07 10:44:48.780 [destination = orderfailover , address = /10.8.132.135:3306 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - Didn't find the corresponding binlog files from mysql-bin.000020 to mysql-bin.000021 2018-08-07 10:44:48.782 [destination = orderfailover , address = /10.8.132.135:3306 , EventParser] ERROR c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - dump address /10.8.132.135:3306 has an error, retrying. caused by com.alibaba.otter.canal.parse.exception.CanalParseException: can't find start position for orderfailover 2018-08-07 10:44:48.782 [Druid-ConnectionPool-Create-1877078260] ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: , errorCode 0, state null java.sql.SQLException: connect error, url , driverClass org.h2.Driver at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1582) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466) ~[druid-1.1.9.jar:1.1.9] 2018-08-07 10:44:48.782 [destination = orderfailover , address = /10.8.132.135:3306 , EventParser] ERROR com.alibaba.otter.canal.common.alarm.LogAlarmHandler - destination:orderfailover[com.alibaba.otter.canal.parse.exception.CanalParseException: can't find start position for orderfailover ] 2018-08-07 10:44:49.282 [Druid-ConnectionPool-Create-1877078260] ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: , errorCode 0, state null java.sql.SQLException: connect error, url , driverClass org.h2.Driver at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1582) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466) ~[druid-1.1.9.jar:1.1.9] 2018-08-07 10:44:49.783 [Druid-ConnectionPool-Create-1877078260] ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: , errorCode 0, state null java.sql.SQLException: connect error, url , driverClass org.h2.Driver at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1582) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466) ~[druid-1.1.9.jar:1.1.9] 2018-08-07 10:44:50.283 [Druid-ConnectionPool-Create-1877078260] ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: , errorCode 0, state null java.sql.SQLException: connect error, url , driverClass org.h2.Driver at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1582) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466) ~[druid-1.1.9.jar:1.1.9] 2018-08-07 10:44:50.783 [Druid-ConnectionPool-Create-1877078260] ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: , errorCode 0, state null java.sql.SQLException: connect error, url , driverClass org.h2.Driver at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1582) ~[druid-1.1.9.jar:1.1.9] at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2466) ~[druid-1.1.9.jar:1.1.9] 2018-08-07 10:44:51.283 [Druid-ConnectionPool-Create-1877078260] ERROR com.alibaba.druid.pool.DruidDataSource - create connection SQLException, url: , errorCode 0, state null
原提问者GitHub用户wangjinzhao
主要原因为h2-tsdb.xml里依赖了System里的canal.instance.destination变量定义,在主备切换时是有一个异步现场操作,该值为空导致
原回答者GitHub用户agapple
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。