开发者社区> 问答> 正文

server启动后 example instance 和master 一会就莫名的断开连接 , 没有

我是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

展开
收起
绿子直子 2023-05-09 15:22:59 109 0
1 条回答
写回答
取消 提交回答
  • 这个问题已经找到原因了,我自己的测试mysql服务器配置的 interactive_timeout 和 wait_timeout 分别为30、20 , 过了20秒后mysql 主动关闭不活跃的连接

    原回答者GitHub用户cclehui

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

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载