开发者社区> 问答> 正文

本机运行正常,服务器报数据库连接失败

请问在本机用源码执行CanalLauncher类,group-instance.xml方式运行正常,放在centos服务器上运行就会报以下错误,配置文件完全一样。然后服务器上用instance.properties方式运行连接正常。请问怎么修复

2018-01-25 13:35:30.225 [destination = group_mysql , address = /10.138.225.198:3306 , EventParser] ERROR c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - parse events has an error com.alibaba.otter.canal.parse.exception.CanalParseException: dump address /10.138.225.198:3306 has an error, retrying. Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: java.io.IOException: connect /10.138.225.198:3306 failure Caused by: java.io.IOException: connect /10.138.225.198:3306 failure at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:72) ~[canal.parse.driver-1.0.25.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.connect(MysqlConnection.java:71) ~[canal.parse-1.0.25.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser.preDump(MysqlEventParser.java:88) ~[canal.parse-1.0.25.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:160) ~[canal.parse-1.0.25.jar:na] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_102] Caused by: java.lang.InterruptedException: null at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1302) ~[na:1.8.0_102] at com.alibaba.otter.canal.common.utils.BooleanMutex$Sync.innerGet(BooleanMutex.java:123) ~[canal.common-1.0.25.jar:na] at com.alibaba.otter.canal.common.utils.BooleanMutex.get(BooleanMutex.java:53) ~[canal.common-1.0.25.jar:na] at com.alibaba.otter.canal.parse.driver.mysql.socket.SocketChannelPool.open(SocketChannelPool.java:71) ~[canal.parse.driver-1.0.25.jar:na] at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:67) ~[canal.parse.driver-1.0.25.jar:na] ... 4 common frames omitted

直接把源码放上去跑报的错,debug日志 2018-01-26 15:44:43.706 [destination = group_mysql , address = /10.138.225.198:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - the channel /10.138.225.198:3306 is not connected 2018-01-26 15:44:43.708 [destination = group_mysql , address = /10.138.225.198:3306 , EventParser] ERROR c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - java.lang.InterruptedException: AbstractBootstrap$PendingRegistrationPromise@6d9c2400(incomplete) at io.netty.util.concurrent.DefaultPromise.await(DefaultPromise.java:230) at io.netty.channel.DefaultChannelPromise.await(DefaultChannelPromise.java:129) at io.netty.channel.DefaultChannelPromise.await(DefaultChannelPromise.java:28) at io.netty.util.concurrent.DefaultPromise.sync(DefaultPromise.java:340) at io.netty.channel.DefaultChannelPromise.sync(DefaultChannelPromise.java:117) at io.netty.channel.DefaultChannelPromise.sync(DefaultChannelPromise.java:28) at com.alibaba.otter.canal.parse.driver.mysql.socket.SocketChannelPool.open(SocketChannelPool.java:60) at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:70) at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.connect(MysqlConnection.java:74) at com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser.preDump(MysqlEventParser.java:87) at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:160) at java.lang.Thread.run(Thread.java:745)

2018-01-26 15:44:43.710 [destination = group_mysql , address = /10.138.225.198:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - the channel /10.138.225.198:3306 is not connected 2018-01-26 15:44:43.710 [destination = group_mysql , address = /10.138.225.198:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - the channel /10.138.225.198:3306 is not connected 2018-01-26 15:44:43.713 [destination = group_mysql , address = /10.138.225.198:3306 , EventParser] ERROR c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - parse events has an error com.alibaba.otter.canal.parse.exception.CanalParseException: dump address /10.138.225.198:3306 has an error, retrying. Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: java.io.IOException: connect /10.138.225.198:3306 failure Caused by: java.io.IOException: connect /10.138.225.198:3306 failure at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:76) ~[class/:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.connect(MysqlConnection.java:74) ~[class/:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser.preDump(MysqlEventParser.java:87) ~[class/:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:160) ~[class/:na] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_102] Caused by: java.lang.InterruptedException: AbstractBootstrap$PendingRegistrationPromise@6d9c2400(incomplete) at io.netty.util.concurrent.DefaultPromise.await(DefaultPromise.java:230) ~[netty-all-4.1.6.Final.jar:4.1.6.Final] at io.netty.channel.DefaultChannelPromise.await(DefaultChannelPromise.java:129) ~[netty-all-4.1.6.Final.jar:4.1.6.Final] at io.netty.channel.DefaultChannelPromise.await(DefaultChannelPromise.java:28) ~[netty-all-4.1.6.Final.jar:4.1.6.Final] at io.netty.util.concurrent.DefaultPromise.sync(DefaultPromise.java:340) ~[netty-all-4.1.6.Final.jar:4.1.6.Final] at io.netty.channel.DefaultChannelPromise.sync(DefaultChannelPromise.java:117) ~[netty-all-4.1.6.Final.jar:4.1.6.Final] at io.netty.channel.DefaultChannelPromise.sync(DefaultChannelPromise.java:28) ~[netty-all-4.1.6.Final.jar:4.1.6.Final] at com.alibaba.otter.canal.parse.driver.mysql.socket.SocketChannelPool.open(SocketChannelPool.java:60) ~[class/:na] at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:70) ~[class/:na] ... 4 common frames omitted 2018-01-26 15:44:43.713 [canal-instance-scan-0] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - disConnect MysqlConnection to /10.138.225.197:3306... 2018-01-26 15:44:43.713 [canal-instance-scan-0] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - the channel /10.138.225.197:3306 is not connected 2018-01-26 15:44:43.713 [destination = group_mysql , address = /10.138.225.197:3306 , EventParser] INFO c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - the channel /10.138.225.197:3306 is not connected 2018-01-26 15:44:43.713 [destination = group_mysql , address = /10.138.225.197:3306 , EventParser] ERROR c.alibaba.otter.canal.parse.driver.mysql.MysqlConnector - java.lang.InterruptedException at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:998) at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1304) at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:231) at com.alibaba.otter.canal.parse.driver.mysql.socket.SocketChannelPool.open(SocketChannelPool.java:63) at com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect(MysqlConnector.java:70) at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.connect(MysqlConnection.java:74) at com.alibaba.otter.canal.parse.inbound.mysql.MysqlEventParser.preDump(MysqlEventParser.java:87) at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:160) at java.lang.Thread.run(Thread.java:745)

原提问者GitHub用户undeadwing

展开
收起
绿子直子 2023-05-09 10:54:24 110 0
1 条回答
写回答
取消 提交回答
  • 找到了,启动参数里的-DappName=otter-canal去掉就好了。。。奇怪为啥这个参数会有影响

    原回答者GitHub用户undeadwing

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

相关电子书

更多
如何运维千台以上游戏云服务器 立即下载
网站/服务器取证 实践与挑战 立即下载
ECS块储存产品全面解析 立即下载