记一次Seata无法连接的问题(Host unreachable)

记一次Seata无法连接的问题(Host unreachable)

一、背景

seata所在服务器重启之后,其他的微服务无法连接seata。

二、报错信息

10:40:39.006 [timeoutChecker_1] ERROR i.s.c.r.n.NettyClientChannelManager - 0101 can not connect to 192.168.88.188:8091 cause:can not register RM,err:can not connect to services-server.
io.seata.common.exception.FrameworkException: can not register RM,err:can not connect to services-server.
at io.seata.core.rpc.netty.NettyClientChannelManager.doConnect(NettyClientChannelManager.java:206)
at io.seata.core.rpc.netty.NettyClientChannelManager.acquireChannel(NettyClientChannelManager.java:102)
at io.seata.core.rpc.netty.NettyClientChannelManager.reconnect(NettyClientChannelManager.java:171)
at io.seata.core.rpc.netty.AbstractRpcRemotingClient$1.run(AbstractRpcRemotingClient.java:113)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
10:40:39.006 [timeoutChecker_1] INFO i.s.c.r.n.NettyClientChannelManager - will connect to 192.168.88.188:8091
10:40:39.006 [timeoutChecker_1] INFO io.seata.core.rpc.netty.RmRpcClient - RM will register :jdbc:mysql://mysql-master.mysql/smdb_system
10:40:39.006 [timeoutChecker_1] INFO i.s.c.rpc.netty.NettyPoolableFactory - NettyPool create channel to transactionRole:RMROLE,address:192.168.88.188:8091,msg:< RegisterRMRequest{resourceIds='jdbc:mysql://mysql-master.mysql/xxx', applicationId='xxx', transactionServiceGroup='xxx'} >
10:40:39.256 [timeoutChecker_1] INFO i.s.c.r.n.NettyClientChannelManager - will connect to 192.168.88.188:8091
10:40:39.256 [timeoutChecker_1] INFO i.s.c.rpc.netty.NettyPoolableFactory - NettyPool create channel to transactionRole:TMROLE,address:192.168.88.188:8091,msg:< RegisterTMRequest{applicationId='xxx', transactionServiceGroup='xxx'} >
10:40:39.257 [NettyClientSelector_TMROLE_1] INFO i.s.c.rpc.netty.AbstractRpcRemoting - ChannelHandlerContext(TmRpcClient#0, [id: 0xbf7f45c3]) will closed
10:40:39.257 [timeoutChecker_1] ERROR i.s.c.r.n.NettyClientChannelManager - 0304 register RM failed.
io.seata.common.exception.FrameworkException: can not connect to services-server.
at io.seata.core.rpc.netty.RpcClientBootstrap.getNewChannel(RpcClientBootstrap.java:195)
at io.seata.core.rpc.netty.NettyPoolableFactory.makeObject(NettyPoolableFactory.java:60)
at io.seata.core.rpc.netty.NettyPoolableFactory.makeObject(NettyPoolableFactory.java:35)
at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1220)
at io.seata.core.rpc.netty.NettyClientChannelManager.doConnect(NettyClientChannelManager.java:202)
at io.seata.core.rpc.netty.NettyClientChannelManager.acquireChannel(NettyClientChannelManager.java:102)
at io.seata.core.rpc.netty.NettyClientChannelManager.reconnect(NettyClientChannelManager.java:171)
at io.seata.core.rpc.netty.AbstractRpcRemotingClient$1.run(AbstractRpcRemotingClient.java:113)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Caused by: io.seata.common.exception.FrameworkException: connect failed, can not connect to services-server.
at io.seata.core.rpc.netty.RpcClientBootstrap.getNewChannel(RpcClientBootstrap.java:190)
... 15 common frames omitted
Caused by: io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: Host is unreachable: /192.168.88.188:8091
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:327)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:340)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:665)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:612)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:529)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:491)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:905)
... 2 common frames omitted
Caused by: java.net.NoRouteToHostException: Host is unreachable
... 11 common frames omitted
10:40:39.257 [timeoutChecker_1] ERROR i.s.c.r.n.NettyClientChannelManager - 0101 can not connect to 192.168.88.188:8091 cause:can not register RM,err:can not connect to services-server.
io.seata.common.exception.FrameworkException: can not register RM,err:can not connect to services-server.
at io.seata.core.rpc.netty.NettyClientChannelManager.doConnect(NettyClientChannelManager.java:206)
at io.seata.core.rpc.netty.NettyClientChannelManager.acquireChannel(NettyClientChannelManager.java:102)
at io.seata.core.rpc.netty.NettyClientChannelManager.reconnect(NettyClientChannelManager.java:171)
at io.seata.core.rpc.netty.AbstractRpcRemotingClient$1.run(AbstractRpcRemotingClient.java:113)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)

分析报错日志:

  • Caused by: io.seata.common.exception.FrameworkException: connect failed, can not connect to services-server.

  • Caused by: io.netty.channel.AbstractChannel$AnnotatedNoRouteToHostException: Host is unreachable: /192.168.88.188:8091

  • Caused by: java.net.NoRouteToHostException: Host is unreachable

可以看到是连接的问题,host unreachable。但是seata明明启动了啊,也可以ping 通。查阅资料后发现有可能是防火墙的问题。

已检查防火墙配置

systemctl status firewalld

好家伙,还真是防火墙没关。

马上操作

三、解决方案

1、关闭防火墙

systemctl stop firewalld

2、开机禁用防火墙。

systemctl disable firewalld

当然如果仍希望使用防火墙,可以配置iptables规则。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值