开发者社区> 问答> 正文

Canal服务器重启后,SlaveID被强制更新为-1

运行环境:

Zookeeper集群 单Canal服务器(测试) 单Canal客户端(测试) 2个MySQL实例(不断有新binlog)

问题:

某次Canal关闭时stop操作无响应,无奈之下采用kill -9 pid强制关闭canal进程。

下次启动Canal时抛出“Canal节点已存在”异常,之后再次重启Canal时异常莫名其妙的消失了,应该是因为Zookeeper检测到Canal离线,自动删除了。

一番周折之后,成功启动后的Canal不再读取binlog,反而打印warn日志:prepare to find start position just last position,此时mysql中binlog是持续存在的。

我手动查看zookeeper中存储的canal数据时发现: [zookeeper] get /otter/canal/destinations/{名称}/1001/cursor {"@type":"com.alibaba.otter.canal.protocol.position.LogPosition","identity":{"slaveId":-1,"sourceAddress":{"address":"...","port":3310}},"postion":{"included":false,"journalName":"localhost-bin.000008","position":689389260,"timestamp":1388062800000}}

请注意"slaveId":-1,我采用的是Canal默认配置slaveId=1234, 现在变为-1真是莫名其妙。我怀疑是Canal出现异常后,自动更改为-1的,于是我手动将此salveID从-1重新改为1234, 但是之后再次启动Canal发现此slaveID又被强制改变为-1.

由于slaveid被改变为-1, 之后canal就无法读取到binlog数据。

以下是canal其中一个mysql实例的启动日志(已开启debug级别),希望大家能帮我解决这个问题:

2013-12-27 09:51:57.745 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.PluggableSchemaResolver - Found XML schema [http://www.springframework.org/schema/beans/spring-beans-2.0.xsd] in classpath: org/springframework/beans/factory/xml/spring-beans-2.0.xsd 2013-12-27 09:51:57.860 [canal-instance-scan-0] DEBUG o.s.b.factory.xml.DefaultBeanDefinitionDocumentReader - Loading bean definitions 2013-12-27 09:51:57.898 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer#0] 2013-12-27 09:51:57.903 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [org.springframework.beans.factory.config.CustomEditorConfigurer#0] 2013-12-27 09:51:57.907 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.meta.ZooKeeperMetaManager#291792b7] 2013-12-27 09:51:57.911 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.parse.ha.HeartBeatHAController#4aa14174] 2013-12-27 09:51:57.913 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter#55d580a8] 2013-12-27 09:51:57.915 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.parse.index.MemoryLogPositionManager#33f1c19e] 2013-12-27 09:51:57.915 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.parse.index.MetaLogPositionManager#44de86b6] 2013-12-27 09:51:57.915 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.parse.index.FailbackLogPositionManager#6d5e3a0c] 2013-12-27 09:51:57.916 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.parse.support.AuthenticationInfo#453521ec] 2013-12-27 09:51:57.917 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.parse.support.AuthenticationInfo#23463073] 2013-12-27 09:51:57.918 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.protocol.position.EntryPosition#5516e01c] 2013-12-27 09:51:57.919 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.BeanDefinitionParserDelegate - Neither XML 'id' nor 'name' specified - using generated bean name [com.alibaba.otter.canal.protocol.position.EntryPosition#50d379e8] 2013-12-27 09:51:57.920 [canal-instance-scan-0] DEBUG o.s.beans.factory.xml.XmlBeanDefinitionReader - Loaded 10 bean definitions from location pattern [classpath:spring/default-instance.xml] 2013-12-27 09:51:57.920 [canal-instance-scan-0] INFO o.s.context.support.ClassPathXmlApplicationContext - Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@344d638a]: org.springframework.beans.factory.support.DefaultListableBeanFactory@6be897cc 2013-12-27 09:51:57.920 [canal-instance-scan-0] DEBUG o.s.context.support.ClassPathXmlApplicationContext - 10 beans defined in org.springframework.context.support.ClassPathXmlApplicationContext@344d638a: display name [org.springframework.context.support.ClassPathXmlApplicationContext@344d638a]; startup date [Fri Dec 27 09:51:57 CST 2013]; root of context hierarchy 2013-12-27 09:51:57.980 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer#0' 2013-12-27 09:51:57.981 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer#0' 2013-12-27 09:51:58.021 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer#0' to allow for resolving potential circular references 2013-12-27 09:51:58.066 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer#0' 2013-12-27 09:51:58.067 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer#0' 2013-12-27 09:51:58.069 [canal-instance-scan-0] INFO c.a.o.c.i.spring.support.PropertyPlaceholderConfigurer - Loading properties file from class path resource [canal.properties] 2013-12-27 09:51:58.070 [canal-instance-scan-0] INFO c.a.o.c.i.spring.support.PropertyPlaceholderConfigurer - Loading properties file from class path resource [war_wist_ios_cn_h17_ww2/instance.properties] 2013-12-27 09:51:58.138 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.beans.factory.config.CustomEditorConfigurer#0' 2013-12-27 09:51:58.138 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'org.springframework.beans.factory.config.CustomEditorConfigurer#0' 2013-12-27 09:51:58.139 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'org.springframework.beans.factory.config.CustomEditorConfigurer#0' to allow for resolving potential circular references 2013-12-27 09:51:58.143 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'socketAddressEditor' 2013-12-27 09:51:58.144 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'socketAddressEditor' 2013-12-27 09:51:58.144 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'socketAddressEditor' to allow for resolving potential circular references 2013-12-27 09:51:58.157 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'socketAddressEditor' 2013-12-27 09:51:58.169 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'org.springframework.beans.factory.config.CustomEditorConfigurer#0' 2013-12-27 09:51:58.174 [canal-instance-scan-0] DEBUG o.s.context.support.ClassPathXmlApplicationContext - Unable to locate MessageSource with name 'messageSource': using default [org.springframework.context.support.DelegatingMessageSource@d170baf] 2013-12-27 09:51:58.177 [canal-instance-scan-0] DEBUG o.s.context.support.ClassPathXmlApplicationContext - Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@5ee5c122] 2013-12-27 09:51:58.180 [canal-instance-scan-0] INFO o.s.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@6be897cc: defining beans [com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer#0,socketAddressEditor,org.springframework.beans.factory.config.CustomEditorConfigurer#0,instance,alarmHandler,zkClientx,metaManager,eventStore,eventSink,eventParser]; root of factory hierarchy 2013-12-27 09:51:58.180 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer#0' 2013-12-27 09:51:58.180 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'socketAddressEditor' 2013-12-27 09:51:58.180 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'org.springframework.beans.factory.config.CustomEditorConfigurer#0' 2013-12-27 09:51:58.180 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'instance' 2013-12-27 09:51:58.181 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'instance' 2013-12-27 09:51:58.183 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'instance' to allow for resolving potential circular references 2013-12-27 09:51:58.215 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'eventParser' 2013-12-27 09:51:58.215 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'eventParser' 2013-12-27 09:51:58.225 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'eventParser' to allow for resolving potential circular references 2013-12-27 09:51:58.246 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'eventSink' 2013-12-27 09:51:58.246 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'eventSink' 2013-12-27 09:51:58.249 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'eventSink' to allow for resolving potential circular references 2013-12-27 09:51:58.260 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'eventStore' 2013-12-27 09:51:58.260 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'eventStore' 2013-12-27 09:51:58.264 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'eventStore' to allow for resolving potential circular references 2013-12-27 09:51:58.283 [canal-instance-scan-0] DEBUG org.springframework.beans.BeanUtils - No property editor [com.alibaba.otter.canal.store.model.BatchModeEditor] found for type com.alibaba.otter.canal.store.model.BatchMode according to 'Editor' suffix convention 2013-12-27 09:51:58.285 [canal-instance-scan-0] WARN org.springframework.beans.TypeConverterDelegate - PropertyEditor [com.sun.beans.editors.EnumEditor] found through deprecated global PropertyEditorManager fallback - consider using a more isolated form of registration, e.g. on the BeanWrapper/BeanFactory! 2013-12-27 09:51:58.286 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'eventStore' 2013-12-27 09:51:58.286 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'eventSink' 2013-12-27 09:51:58.287 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Added autowiring by name from bean name 'eventParser' via property 'eventSink' to bean named 'eventSink' 2013-12-27 09:51:58.288 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.parse.ha.HeartBeatHAController#4aa14174' 2013-12-27 09:51:58.296 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.parse.ha.HeartBeatHAController#4aa14174' 2013-12-27 09:51:58.296 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'alarmHandler' 2013-12-27 09:51:58.297 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'alarmHandler' 2013-12-27 09:51:58.297 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'alarmHandler' to allow for resolving potential circular references 2013-12-27 09:51:58.302 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'alarmHandler' 2013-12-27 09:51:58.303 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter#55d580a8' 2013-12-27 09:51:58.466 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.filter.aviater.AviaterRegexFilter#55d580a8' 2013-12-27 09:51:58.467 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.parse.index.FailbackLogPositionManager#6d5e3a0c' 2013-12-27 09:51:58.476 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.parse.index.MemoryLogPositionManager#33f1c19e' 2013-12-27 09:51:58.483 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.parse.index.MemoryLogPositionManager#33f1c19e' 2013-12-27 09:51:58.484 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.parse.index.MetaLogPositionManager#44de86b6' 2013-12-27 09:51:58.491 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'metaManager' 2013-12-27 09:51:58.491 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'metaManager' 2013-12-27 09:51:58.493 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'metaManager' to allow for resolving potential circular references 2013-12-27 09:51:58.504 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.meta.ZooKeeperMetaManager#291792b7' 2013-12-27 09:51:58.511 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean 'zkClientx' 2013-12-27 09:51:58.511 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'zkClientx' 2013-12-27 09:51:58.512 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean 'zkClientx' to allow for resolving potential circular references 2013-12-27 09:51:58.523 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Invoking afterPropertiesSet() on bean with name 'zkClientx' 2013-12-27 09:51:58.523 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'zkClientx' 2013-12-27 09:51:58.525 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.meta.ZooKeeperMetaManager#291792b7' 2013-12-27 09:51:58.525 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'metaManager' 2013-12-27 09:51:58.526 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.parse.index.MetaLogPositionManager#44de86b6' 2013-12-27 09:51:58.526 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.parse.index.FailbackLogPositionManager#6d5e3a0c' 2013-12-27 09:51:58.526 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.parse.support.AuthenticationInfo#453521ec' 2013-12-27 09:51:58.531 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.parse.support.AuthenticationInfo#453521ec' 2013-12-27 09:51:58.531 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.parse.support.AuthenticationInfo#23463073' 2013-12-27 09:51:58.532 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.parse.support.AuthenticationInfo#23463073' 2013-12-27 09:51:58.532 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.protocol.position.EntryPosition#5516e01c' 2013-12-27 09:51:58.541 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.protocol.position.EntryPosition#5516e01c' 2013-12-27 09:51:58.541 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean 'com.alibaba.otter.canal.protocol.position.EntryPosition#50d379e8' 2013-12-27 09:51:58.542 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'com.alibaba.otter.canal.protocol.position.EntryPosition#50d379e8' 2013-12-27 09:51:58.543 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'eventParser' 2013-12-27 09:51:58.543 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'eventSink' 2013-12-27 09:51:58.543 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'eventStore' 2013-12-27 09:51:58.543 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'metaManager' 2013-12-27 09:51:58.544 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'alarmHandler' 2013-12-27 09:51:58.544 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean 'instance' 2013-12-27 09:51:58.544 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'alarmHandler' 2013-12-27 09:51:58.544 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'zkClientx' 2013-12-27 09:51:58.545 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'metaManager' 2013-12-27 09:51:58.545 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'eventStore' 2013-12-27 09:51:58.545 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'eventSink' 2013-12-27 09:51:58.545 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'eventParser' 2013-12-27 09:51:58.546 [canal-instance-scan-0] DEBUG o.s.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean 'instance' 2013-12-27 09:51:58.546 [canal-instance-scan-0] INFO c.a.otter.canal.instance.spring.CanalInstanceWithSpring - start CannalInstance for 1-war_wist_ios_cn_h17_ww2 2013-12-27 09:51:58.577 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - start heart beat.... 2013-12-27 09:51:58.578 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnection to /118.26.235.88:3310... 2013-12-27 09:51:58.596 [canal-instance-scan-0] INFO c.a.otter.canal.instance.spring.CanalInstanceWithSpring - start successful.... 2013-12-27 09:51:58.596 [canal-instance-scan-0] INFO c.a.otter.canal.server.embeded.CanalServerWithEmbeded - start CanalInstances[war_wist_ios_cn_h17_ww2] successfully 2013-12-27 09:52:09.329 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - handshake initialization packet received, prepare the client authentication packet to send 2013-12-27 09:52:09.338 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - client authentication packet is sent out. 2013-12-27 09:52:09.355 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnection to /118.26.235.88:3310... 2013-12-27 09:52:19.509 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - handshake initialization packet received, prepare the client authentication packet to send 2013-12-27 09:52:19.510 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - client authentication packet is sent out. 2013-12-27 09:52:19.541 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - prepare to find start position just last position 2013-12-27 09:52:19.580 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - find start position : EntryPosition[included=false,journalName=localhost-bin.000008,position=679706051,timestamp=1388060804000] 2013-12-27 09:52:19.580 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - disConnect MysqlConnection to /118.26.235.88:3310... 2013-12-27 09:52:19.580 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnection to /118.26.235.88:3310... 2013-12-27 09:52:29.239 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - handshake initialization packet received, prepare the client authentication packet to send 2013-12-27 09:52:29.240 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - client authentication packet is sent out. 2013-12-27 09:52:29.244 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] DEBUG c.a.otter.canal.parse.driver.mysql.MysqlUpdateExecutor - read update result... 2013-12-27 09:52:29.748 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] DEBUG c.a.otter.canal.parse.driver.mysql.MysqlUpdateExecutor - read update result... 2013-12-27 09:52:29.830 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] DEBUG c.a.otter.canal.parse.driver.mysql.MysqlUpdateExecutor - read update result... 2013-12-27 09:52:29.831 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] DEBUG c.a.otter.canal.parse.driver.mysql.MysqlUpdateExecutor - read update result... 2013-12-27 09:52:29.957 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] DEBUG c.a.otter.canal.parse.driver.mysql.MysqlUpdateExecutor - read update result... 2013-12-27 09:52:30.053 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO c.a.otter.canal.parse.inbound.mysql.MysqlConnection - COM_BINLOG_DUMP with position:BinlogDumpCommandPacket[binlogPosition=679706051,slaveServerId=1234,binlogFileName=localhost-bin.000008,command=18] 2013-12-27 09:52:30.346 [destination = war_wist_ios_cn_h17_ww2 , address = /118.26.235.88:3310 , EventParser] INFO com.taobao.tddl.dbsync.binlog.LogEvent - common_header_len= 19, number_of_event_types= 27 2013-12-27 09:52:50.072 [New I/O server worker #1-2] INFO c.a.otter.canal.server.embeded.CanalServerWithEmbeded - rollback successfully, clientId:1001 2013-12-27 09:52:50.073 [New I/O server worker #1-2] INFO c.a.otter.canal.server.embeded.CanalServerWithEmbeded - subscribe successfully, use last cursor position:ClientIdentity[destination=war_wist_ios_cn_h17_ww2,clientId=1001,filter=...] 2013-12-27 09:52:50.115 [New I/O server worker #1-2] INFO c.a.otter.canal.server.embeded.CanalServerWithEmbeded - rollback successfully, clientId:1001 2013-12-27 09:52:50.118 [New I/O server worker #1-2] INFO c.a.otter.canal.server.embeded.CanalServerWithEmbeded - getWithoutAck successfully, clientId:1001 batchSize:1000 real size is 619 and result is [batchId:1 , position:PositionRange[start=LogPosition[identity=LogIdentity[sourceAddress=/118.26.235.88:3310,slaveId=-1],postion=EntryPosition[included=false,journalName=localhost-bin.000008,position=679706051,timestamp=1388060804000]],ack=LogPosition[identity=LogIdentity[sourceAddress=/118.26.235.88:3310,slaveId=-1],postion=EntryPosition[included=false,journalName=localhost-bin.000008,position=689389260,timestamp=1388062800000]],end=LogPosition[identity=LogIdentity[sourceAddress=/118.26.235.88:3310,slaveId=-1],postion=EntryPosition[included=false,journalName=localhost-bin.000008,position=689389260,timestamp=1388062800000]]]] 2013-12-27 09:52:50.240 [New I/O server worker #1-2] INFO c.a.otter.canal.server.embeded.CanalServerWithEmbeded - ack successfully, clientId:1001 batchId:1 position:PositionRange[start=LogPosition[identity=LogIdentity[sourceAddress=/118.26.235.88:3310,slaveId=-1],postion=EntryPosition[included=false,journalName=localhost-bin.000008,position=679706051,timestamp=1388060804000]],ack=LogPosition[identity=LogIdentity[sourceAddress=/118.26.235.88:3310,slaveId=-1],postion=EntryPosition[included=false,journalName=localhost-bin.000008,position=689389260,timestamp=1388062800000]],end=LogPosition[identity=LogIdentity[sourceAddress=/118.26.235.88:3310,slaveId=-1],postion=EntryPosition[included=false,journalName=localhost-bin.000008,position=689389260,timestamp=1388062800000]]] 2013-12-27 09:52:50.248 [New I/O server worker #1-2] DEBUG c.a.otter.canal.server.embeded.CanalServerWithEmbeded - getWithoutAck successfully, clientId:1001 batchSize:1000 but result is null 2013-12-27 09:52:51.291 [New I/O server worker #1-2] DEBUG c.a.otter.canal.server.embeded.CanalServerWithEmbeded - getWithoutAck successfully, clientId:1001 batchSize:1000 but result is null 2013-12-27 09:52:52.335 [New I/O server worker #1-2] DEBUG c.a.otter.canal.server.embeded.CanalServerWithEmbeded - getWithoutAck successfully, clientId:1001 batchSize:1000 but result is null 2013-12-27 09:52:53.380 [New I/O server worker #1-2] INFO c.a.otter.canal.server.embeded.CanalServerWithEmbeded - getWithoutAck successfully, clientId:1001 batchSize:1000 real size is 327 and result is [batchId:2 , position:PositionRange[start=LogPosition[identity=LogIdentity[sourceAddress=/118.26.235.88:3310,slaveId=-1],postion=EntryPosition[included=false,journalName=localhost-bin.000008,position=696177601,timestamp=1388062803000]],ack=LogPosition[identity=LogIdentity[sourceAddress=/118.26.235.88:3310,slaveId=-1],postion=EntryPosition[included=false,journalName=localhost-bin.000008,position=696612594,timestamp=1388062803000]],end=LogPosition[identity=LogIdentity[sourceAddress=/118.26.235.88:3310,slaveId=-1],postion=EntryPosition[included=false,journalName=localhost-bin.000008,position=696612594,timestamp=1388062803000]]]]

原提问者GitHub用户sisyphsu

展开
收起
绿子直子 2023-05-09 16:10:31 219 0
2 条回答
写回答
取消 提交回答
  • 解释几个问题:

    1、prepare to find start position just last position. 这里是正常的,当前启动是从上一次的位点继续,这里的last position理解为最后一次的消费位点

    2、kill -9强制关闭后,抛出“Canal节点已存在”异常后自动删除,这个理解是对的,是zookeeper server有个sessionTimeout时间,超过这个时间后才会自动删除节点,正常退出时canal会自己删除,所以不会有问题

    3、slaveId = -1,这个是目前已知的,代码里本身就没有把正确的slaveId写到zookeeper中,每次都会从canal.properties中读取slaveId,这个不影响

    原回答者GitHub用户agapple

    2023-05-10 11:09:34
    赞同 展开评论 打赏
  • 可以初步判断是Canal在异常退出后,没有正确地清理掉之前的状态信息,导致下次启动时出现了一些意料之外的问题。具体来说,可能是Canal的meta信息没有正确地更新,或者是Zookeeper中的数据没有正确地清理。

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

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS快储存加密技术 立即下载