我是2017-02-27从master上拉取的分支编译的, Mysql版本:5.5.32
启动服务:正常
2017-03-02 17:27:58.627 [main] INFO com.alibaba.otter.canal.deployer.CanalLauncher - ## start the canal server. 2017-03-02 17:27:58.924 [main] INFO com.alibaba.otter.canal.deployer.CanalController - ## start the canal server[my ip :11111] 2017-03-02 17:28:00.401 [main] INFO com.alibaba.otter.canal.deployer.CanalLauncher - ## the canal server is running now ......
example instance 启动失败, 该instance启动连接上了mysql, 然后莫名奇妙的做了一个 disConnect 断开了链接 , 没有然后就没有任何log了 , 服务还是在运行,但该instance没有起来 , 和mysql的链接也没有建立起来 。而且很奇怪的是连接了两次mysql 。 instance的启动log如下
2017-03-02 17:27:59.019 [main] INFO o.s.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@68bbe345: display name [org.springframework.context.support.ClassPathXmlApplicationContext@68bbe345]; startup date [Thu Mar 02 17:27:59 CST 2017]; root of context hierarchy 2017-03-02 17:27:59.133 [main] INFO o.s.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [spring/file-instance.xml] 2017-03-02 17:27:59.516 [main] INFO o.s.context.support.ClassPathXmlApplicationContext - Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@68bbe345]: org.springframework.beans.factory.support.DefaultListableBeanFactory@78186a70 2017-03-02 17:27:59.642 [main] INFO c.a.o.c.i.spring.support.PropertyPlaceholderConfigurer - Loading properties file from class path resource [canal.properties] 2017-03-02 17:27:59.643 [main] INFO c.a.o.c.i.spring.support.PropertyPlaceholderConfigurer - Loading properties file from class path resource [example/instance.properties] 2017-03-02 17:27:59.697 [main] INFO o.s.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@78186a70: defining beans [com.alibaba.otter.canal.instance.spring.support.PropertyPlaceholderConfigurer#0,socketAddressEditor,org.springframework.beans.factory.config.CustomEditorConfigurer#0,instance,alarmHandler,metaManager,eventStore,eventSink,eventParser]; root of factory hierarchy 2017-03-02 17:27:59.851 [main] 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! 2017-03-02 17:28:00.131 [main] INFO c.a.otter.canal.instance.spring.CanalInstanceWithSpring - start CannalInstance for 1-example 2017-03-02 17:28:00.158 [main] INFO c.a.otter.canal.instance.core.AbstractCanalInstance - start successful.... 2017-03-02 17:28:00.158 [main] INFO c.a.otter.canal.server.embedded.CanalServerWithEmbedded - start CanalInstances[example] successfully 2017-03-02 17:28:00.177 [destination = example , address = /127.0.0.1:3306 , EventParser] INFO c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - start heart beat.... 2017-03-02 17:28:00.936 [destination = example , address = /127.0.0.1:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnection to /127.0.0.1:3306... 2017-03-02 17:28:00.944 [destination = example , address = /127.0.0.1:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - handshake initialization packet received, prepare the client authentication packet to send 2017-03-02 17:28:00.973 [destination = example , address = /127.0.0.1:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - client authentication packet is sent out. 2017-03-02 17:28:00.989 [destination = example , address = /127.0.0.1:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - connect MysqlConnection to /127.0.0.1:3306... 2017-03-02 17:28:00.991 [destination = example , address = /127.0.0.1:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - handshake initialization packet received, prepare the client authentication packet to send 2017-03-02 17:28:00.991 [destination = example , address = /127.0.0.1:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - client authentication packet is sent out. 2017-03-02 17:28:00.993 [destination = example , address = /127.0.0.1:3306 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - prepare to find start position just show master status 2017-03-02 17:28:01.013 [destination = example , address = /127.0.0.1:3306 , EventParser] INFO c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - find start position : EntryPosition[included=false,journalName=mysql-bin.000004,position=121250,serverId=,timestamp=] 2017-03-02 17:28:01.023 [destination = example , address = /127.0.0.1:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - disConnect MysqlConnection to /127.0.0.1:3306...
mysql 的 tcp连接情况:
刚启动的时候:
tcp 0 0 127.0.0.1:3306 127.0.0.1:60383 ESTABLISHED 18565/mysqld
tcp 0 0 127.0.0.1:60383 127.0.0.1:3306 ESTABLISHED 1273/java
tcp 0 0 127.0.0.1:3306 127.0.0.1:60381 ESTABLISHED 18565/mysqld
tcp 0 0 127.0.0.1:60381 127.0.0.1:3306 ESTABLISHED 1273/java ```
过一会这两个连接都断了
原提问者GitHub用户cclehui
这个问题已经找到原因了,我自己的测试mysql服务器配置的 interactive_timeout 和 wait_timeout 分别为30、20 , 过了20秒后mysql 主动关闭不活跃的连接
原回答者GitHub用户cclehui
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。