nacos在192.168.11.13服务器启动着,访问正常
本地服务器在192.168.11.11启动,启动日志报错
Server check fail, please check server 192.168.11.13 ,port 9848 is available , error ={}
2021-10-09 17:33:16.178 ERROR 21512 --- [ main] c.a.n.c.remote.client.grpc.GrpcClient : Server check fail, please check server 192.168.11.13 ,port 9848 is available , error ={}
java.util.concurrent.TimeoutException: Waited 3000 milliseconds (plus 731800 nanoseconds delay) for com.alibaba.nacos.shaded.io.grpc.stub.ClientCalls$GrpcFuture@157ec23b[status=PENDING, info=[GrpcFuture{clientCall={delegate={delegate=ClientCallImpl{method=MethodDescriptor{fullMethodName=Request/request, type=UNARY, idempotent=false, safe=false, sampledToLocalTracing=true, requestMarshaller=com.alibaba.nacos.shaded.io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller@60d6fdd4, responseMarshaller=com.alibaba.nacos.shaded.io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller@66f28a1f, schemaDescriptor=com.alibaba.nacos.api.grpc.auto.RequestGrpc$RequestMethodDescriptorSupplier@60a19573}}}}}]]
at com.alibaba.nacos.shaded.com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:508)
at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.serverCheck(GrpcClient.java:146)
at com.alibaba.nacos.common.remote.client.grpc.GrpcClient.connectToServer(GrpcClient.java:268)
at com.alibaba.nacos.common.remote.client.RpcClient.start(RpcClient.java:395)
at com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient.ensureRpcClient(ClientWorker.java:924)
at com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient.getOneRunningClient(ClientWorker.java:1087)
at com.alibaba.nacos.client.config.impl.ClientWorker$ConfigRpcTransportClient.queryConfig(ClientWorker.java:979)
at com.alibaba.nacos.client.config.impl.ClientWorker.getServerConfig(ClientWorker.java:407)
at com.alibaba.nacos.client.config.NacosConfigService.getConfigInner(NacosConfigService.java:166)
at com.alibaba.nacos.client.config.NacosConfigService.getConfig(NacosConfigService.java:94)
at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.loadNacosData(NacosPropertySourceBuilder.java:85)
at com.alibaba.cloud.nacos.client.NacosPropertySourceBuilder.build(NacosPropertySourceBuilder.java:73)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosPropertySource(NacosPropertySourceLocator.java:199)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosDataIfPresent(NacosPropertySourceLocator.java:186)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadNacosConfiguration(NacosPropertySourceLocator.java:158)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.loadSharedConfiguration(NacosPropertySourceLocator.java:116)
at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.locate(NacosPropertySourceLocator.java:101)
at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:52)
at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47)
at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:98)
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:623)
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:367)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)
at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:50)
at com.ht.bms.custom.CustomApplication.main(CustomApplication.java:31)
虽然报错,但是服务可以正常启动,问题在于本地服务器调用注册在nacos的其他服务时,超时无法调用
但是其他同事在他们的电脑上启动服务,没有报错。
问题已解决:
检查nacos服务器8848,8849,9848,9849是否开放这几个端口,如果是docker启动,需要暴露端口
在端口已经暴露并开放的情况下,依然有问题,我修改了一下idea的配置问题解决:
修改前配置:
修改后:
jre改为了自己本地安装的jre,而不是idea自带的jre
另外把Shorten command line也修改了下
重新启动就不报错了,正常了,但是配置改回去,重新启动依然不报错,很奇怪
可能是缓存原因吧!
祝大家工作愉快!