本文主要解决Nacos启动时失败问题 文章目录 错误信息解决方法Mac m1电脑Docker安装nacos 2.x检查yml文件配置是否配置正确✅Nacos端口是否映射成功Nacos兼容性问题 错误信息 错误信息如下,
本文主要解决Nacos启动时失败问题
错误信息如下,导致该问题的原因有以下几种:
java.util.concurrent.ExecutionException: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVaiLABLE: io exceptionat com.alibaba.nacos.shaded.com.Google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:566) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:445) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.serverCheck(GrpcClient.java:148) [nacos-client-2.0.4.jar:na]at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:264) [nacos-client-2.0.4.jar:na]at com.alibaba.nacos.common.remote.client.RpcClient.reconnect(RpcClient.java:522) [nacos-client-2.0.4.jar:na]at com.alibaba.nacos.common.remote.client.RpcClient.lambda$start$2(RpcClient.java:370) [nacos-client-2.0.4.jar:na]at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_322]at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_322]at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_322]at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_322]at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_322]at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_322]at java.lang.Thread.run(Thread.java:750) ~[na:1.8.0_322]Caused by: com.alibaba.nacos.shaded.io.grpc.StatusRuntimeException: UNAVAILABLE: io exceptionat com.alibaba.nacos.shaded.io.grpc.Status.asRuntimeException(Status.java:533) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:490) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.PartialForwardinGClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.CensusStatsModule$StatsClientInterceptor$1$1.onClose(CensusStatsModule.java:700) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.PartialForwardingClientCallListener.onClose(PartialForwardingClientCallListener.java:39) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.ForwardingClientCallListener.onClose(ForwardingClientCallListener.java:23) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener.onClose(ForwardingClientCallListener.java:40) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.CensusTracingModule$TracingClientInterceptor$1$1.onClose(CensusTracingModule.java:399) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:510) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl.access$300(ClientCallImpl.java:66) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.close(ClientCallImpl.java:630) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl.access$700(ClientCallImpl.java:518) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInternal(ClientCallImpl.java:692) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1StreamClosed.runInContext(ClientCallImpl.java:681) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) ~[nacos-client-2.0.4.jar:na]... 3 common frames omittedCaused by: com.alibaba.nacos.shaded.io.grpc.Netty.shaded.io.netty.channel.AbstractChannel$AnnotatedConnectException: Connection refused: localhost/0:0:0:0:0:0:0:1:9848Caused by: java.net.ConnectException: Connection refusedat sun.NIO.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_322]at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:716) ~[na:1.8.0_322]at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.socket.nio.NiOSocketChannel.doFinishConnect(NioSocketChannel.java:327) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.AbstractNiochannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:336) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:685) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.internal.ThreadExecutORMap$2.run(ThreadExecutorMap.java:74) ~[nacos-client-2.0.4.jar:na]at com.alibaba.nacos.shaded.io.grpc.netty.shaded.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[nacos-client-2.0.4.jar:na]at java.lang.Thread.run(Thread.java:750) ~[na:1.8.0_322]2023-04-09 23:20:24.630 INFO 4851 --- [t.remote.worker] com.alibaba.nacos.common.remote.client : [7c2a43b2-6bbc-4049-b422-9146ed496936] Fail to connect server, after trying 3 times, last try server is {serverIp = 'localhost', server main port = 8848}, error = unknown2023-04-09 23:20:25.045 ERROR 4851 --- [t.remote.worker] c.a.n.c.remote.client.grpc.GrpcClient : Server check fail, please check server localhost ,port 9848 is available , error ={}
电脑mac m1,使用官方的1.4.1版本的nacos启动时报错,找不到,于是替换nacos为2.x,采用Docker安装。
命令行搜索nacos,找到适配Mac m1的镜像
拉去镜像:
docker pull zhusaidong/nacos-server-m1:2.0.3
启动:
打开8848和9848端口
sudo docker run -d -p 8848:8848 -p 9848:9848 --env MODE=standalone --name nacos2 zhusaidong/nacos-server-m1:2.0.3
查看server-addr是否配置正确,端口号是否为默认的8848,或者其他修改的对应的端口号
spring: mvc: pathmatch: matching-strategy: ant_path_matcher application: name: learn-auth cloud: nacos: discovery: server-addr: Http://localhost:8848 config: server-addr: ${spring.cloud.nacos.discovery.server-addr}
nacos 2.x版本,新增了两个端口。这两个端口在nacos原先的端口上(默认8848),进行一定偏移量自动生成。
98481000客户端gRPC请求服务端端口,用于客户端向服务端发起连接和请求98491001服务端gRPC请求服务端端口,用于服务间同步等
比如Centos7环境:
#开启防火墙 systemctl start firewalld #开放9848端口 firewall-cmd --zone=public --add-port=9848/tcp --permanent #使配置生效 firewall-cmd --reload #查看所有端口 firewall-cmd --zone=public --list-ports
服务端2.x向下兼容客户端1.x版本,客户端2.x版本无法使用服务端1.x版本。
查看一下客户端和服务端版本:
<dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-nacos-discovery</artifactId> <version>${nacos.version}</version></dependency><dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-nacos-config</artifactId> <version>${nacos.version}</version></dependency>
来源地址:https://blog.csdn.net/baidu_33256174/article/details/130056322
--结束END--
本文标题: 【nacos启动错误】Server check fail, please check server localhost ,port 9848 is available , error ={}
本文链接: https://lsjlt.com/news/378794.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-04-01
2024-04-03
2024-04-03
2024-01-21
2024-01-21
2024-01-21
2024-01-21
2023-12-23
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0