iohao / ioGame

无锁异步化、事件驱动架构设计的 java netty 网络编程框架; 轻量级,无需依赖任何第三方中间件或数据库就能支持集群、分布式; 适用于网络游戏服务器、物联网、内部系统及各种需要长连接的场景; 通过 ioGame 你可以很容易的搭建出一个集群无中心节点、集群自动化、分布式的网络服务器;FXGL、Unity、UE、Cocos Creator、Godot、Netty、Protobuf、webSocket、tcp、socket;java Netty 游戏服务器框架; Java Netty Game Server.
http://game.iohao.com
GNU Affero General Public License v3.0
920 stars 205 forks source link

在centos环境下运行jar包发生Create connection failed错误 #261

Closed fumengame closed 7 months ago

fumengame commented 7 months ago

在windows idea环境下测试没有问题,但是打jar包到centos环境下,启动时,有时候能成功运行,有时候运行发生连接失败错误。运行失败错误的次数更多一些。 01:22:25 [ioGameThread-2] ERROR c.i.game.bolt.broker.core.client.BrokerClientItem (BrokerClientItem.java:324) - Create connection failed. The address is 10.0.4.15:10200 com.alipay.remoting.exception.RemotingException: Create connection failed. The address is 10.0.4.15:10200 at com.alipay.remoting.DefaultConnectionManager.create(DefaultConnectionManager.java:479) at com.alipay.remoting.DefaultConnectionManager.doCreate(DefaultConnectionManager.java:783) at com.alipay.remoting.DefaultConnectionManager.access$000(DefaultConnectionManager.java:52) at com.alipay.remoting.DefaultConnectionManager$ConnectionPoolCall.call(DefaultConnectionManager.java:710) at com.alipay.remoting.DefaultConnectionManager$ConnectionPoolCall.call(DefaultConnectionManager.java:676) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at com.alipay.remoting.util.RunStateRecordedFutureTask.run(RunStateRecordedFutureTask.java:39) at com.alipay.remoting.DefaultConnectionManager.getConnectionPoolAndCreateIfAbsent(DefaultConnectionManager.java:568) at com.alipay.remoting.DefaultConnectionManager.getAndCreateIfAbsent(DefaultConnectionManager.java:429) at com.alipay.remoting.rpc.RpcClientRemoting.getConnectionAndInitInvokeContext(RpcClientRemoting.java:141) at com.alipay.remoting.rpc.RpcClientRemoting.oneway(RpcClientRemoting.java:53) at com.alipay.remoting.rpc.RpcRemoting.oneway(RpcRemoting.java:91) at com.alipay.remoting.rpc.RpcClient.oneway(RpcClient.java:175) at com.iohao.game.bolt.broker.core.client.BrokerClientItem.send(BrokerClientItem.java:322) at com.iohao.game.bolt.broker.core.client.BrokerClientItem.startup(BrokerClientItem.java:316) at com.iohao.game.bolt.broker.core.client.BrokerClientManager.register(BrokerClientManager.java:109) at com.iohao.game.bolt.broker.core.client.BrokerClientManager.init(BrokerClientManager.java:87) at com.iohao.game.bolt.broker.core.client.BrokerClient.initBrokerClientManager(BrokerClient.java:220) at com.iohao.game.bolt.broker.core.client.BrokerClient.init(BrokerClient.java:158) at com.iohao.game.bolt.broker.client.BrokerClientApplication.start(BrokerClientApplication.java:62) at com.iohao.game.bolt.broker.client.BrokerClientApplication.start(BrokerClientApplication.java:48) at com.iohao.game.external.core.netty.simple.InternalRunOne.lambda$startupLogic$0(InternalRunOne.java:63) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.lang.Exception: Create connection to 10.0.4.15:10200 error! at com.alipay.remoting.connection.AbstractConnectionFactory.doCreateConnection(AbstractConnectionFactory.java:338) at com.alipay.remoting.connection.AbstractConnectionFactory.createConnection(AbstractConnectionFactory.java:186) at com.alipay.remoting.DefaultConnectionManager.create(DefaultConnectionManager.java:476) ... 24 common frames omitted Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: /10.0.4.15:10200 Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused at io.netty.channel.unix.Errors.newConnectException0(Errors.java:166) at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:131) at io.netty.channel.unix.Socket.finishConnect(Socket.java:359) at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.doFinishConnect(AbstractEpollChannel.java:710) at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.finishConnect(AbstractEpollChannel.java:687) at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.epollOutReady(AbstractEpollChannel.java:567) at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:489) at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397) at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) at java.base/java.lang.Thread.run(Thread.java:1583) 01:22:25 [ioGameThread-1] INFO CommonStdout (BrokerServer.java:97) - 启动游戏网关 port: [10200] 启动模式: [单机启动模式 standalone]

使用的是分模块开发,基于ioMMO项目的基础上进行开发的,导出的是单机模式一个包运行。

fumengame commented 7 months ago

不停地关闭,启动。有时候正常启动,有时候部分逻辑服启动连接不起来网关服。

iohao commented 7 months ago

可以提供一个复现 demo 和复现步骤吗

fumengame commented 7 months ago

可以提供一个复现 demo 和复现步骤吗

OK,稍等会,我待会做一个demo给你

fumengame commented 7 months ago

问题已解决,应该是服务端环境问题,采用docker重新部署就没问题了