当前位置: 代码迷 >> 综合 >> seata 指定公网ip出现 java.net.BindException: Cannot assign requested address
  详细解决方案

seata 指定公网ip出现 java.net.BindException: Cannot assign requested address

热度:12   发布时间:2023-12-17 21:39:47.0

指定公网ip

seata默认使用的内网ip注册到注册中心,如果需要使用公网 添加启动参数 -h 公网ip ,记得开启公网端口的安全组策略。

启动出错 Cannot assign requested address

使用seata-0.8.0的版本出现的这个问题,换成0.9.0之后解决,最新版本请访问官方社区或github查看

报错如下

Exception in thread "main" java.lang.RuntimeException: java.net.BindException: Cannot assign requested addressat io.seata.core.rpc.netty.AbstractRpcRemotingServer.start(AbstractRpcRemotingServer.java:184)at io.seata.core.rpc.netty.RpcServer.init(RpcServer.java:130)at io.seata.server.Server.main(Server.java:87)
Caused by: java.net.BindException: Cannot assign requested addressat sun.nio.ch.Net.bind0(Native Method)at sun.nio.ch.Net.bind(Net.java:433)at sun.nio.ch.Net.bind(Net.java:425)at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:130)at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:558)at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1358)at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:501)at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:486)at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:1019)at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:254)at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:366)at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:462)at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)at java.lang.Thread.run(Thread.java:748)
  相关解决方案