try to re connect to a new server ,server is not appointed,will choose a random server

2022-09-16 12:36:52 浏览数 (1)

k8s集群部署的nacos服务接连收到很多nacos-client抛出的更新服务状态异常:

2022-07-23 10:46:39.997  INFO 7 --- [t.remote.worker] com.alibaba.nacos.common.remote.client   : [7b83a82c-d533-4968-9f39-a1d8719f712a]Server healthy check fail,currentConnection=1658453921079_10.233.92.39_47188 2022-07-23 10:46:39.998  INFO 7 --- [t.remote.worker] com.alibaba.nacos.common.remote.client   : [7b83a82c-d533-4968-9f39-a1d8719f712a] try to re connect to a new server ,server is  not appointed,will choose a random server. 2022-07-23 10:46:39.999  INFO 7 --- [t.remote.worker] com.alibaba.nacos.common.remote.client   : [config-0-bae787c4-fa18-4b14-b221-2eb3eed3a68f]Server healthy check fail,currentConnection=1658453909331_10.233.92.39_47058 2022-07-23 10:46:39.999  INFO 7 --- [t.remote.worker] com.alibaba.nacos.common.remote.client   : [config-0-bae787c4-fa18-4b14-b221-2eb3eed3a68f] try to re connect to a new server ,server is  not appointed,will choose a random server. 2022-07-23 10:46:46.119  INFO 7 --- [t.remote.worker] com.alibaba.nacos.common.remote.client   : [7b83a82c-d533-4968-9f39-a1d8719f712a] fail to connect server,after trying 1 times, last try server is {serverIp='nacos-server.xxx', server main port=8848},error=unknown 2022-07-23 10:46:46.120  INFO 7 --- [t.remote.worker] com.alibaba.nacos.common.remote.client   : [config-0-bae787c4-fa18-4b14-b221-2eb3eed3a68f] fail to connect server,after trying 1 times, last try server is {serverIp='nacos-server.xxx', server main port=8848},error=unknown 2022-07-23 10:46:48.713 ERROR 7 --- [aming.updater.0] com.alibaba.nacos.common.remote.client   : Send request fail, request=ServiceQueryRequest{headers={app=unknown}, requestId='null'}, retryTimes=0,errorMessage=Client not connected,current status:UNHEALTHY 2022-07-23 10:46:48.813 ERROR 7 --- [aming.updater.0] com.alibaba.nacos.common.remote.client   : Send request fail, request=ServiceQueryRequest{headers={app=unknown}, requestId='null'}, retryTimes=1,errorMessage=Client not connected,current status:UNHEALTHY 2022-07-23 10:46:48.914 ERROR 7 --- [aming.updater.0] com.alibaba.nacos.common.remote.client   : Send request fail, request=ServiceQueryRequest{headers={app=unknown}, requestId='null'}, retryTimes=2,errorMessage=Client not connected,current status:UNHEALTHY 2022-07-23 10:46:48.914  WARN 7 --- [aming.updater.0] com.alibaba.nacos.client.naming          : [NA] failed to update serviceName: DEFAULT_GROUP@@iot-devicemgr

com.alibaba.nacos.api.exception.NacosException: Request nacos server failed:      at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:213)     at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.queryInstancesOfService(NamingGrpcClientProxy.java:128)     at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.queryInstancesOfService(NamingClientProxyDelegate.java:111)     at com.alibaba.nacos.client.naming.core.ServiceInfoUpdateServiceUpdateTask.run(ServiceInfoUpdateService.java:182)     at java.base/java.util.concurrent.ExecutorsRunnableAdapter.call(Executors.java:515)     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)     at java.base/java.util.concurrent.ScheduledThreadPoolExecutorScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)     at java.base/java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:628)     at java.base/java.lang.Thread.run(Thread.java:829) Caused by: com.alibaba.nacos.api.exception.NacosException: Client not connected,current status:UNHEALTHY     at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:628)     at com.alibaba.nacos.common.remote.client.RpcClient.request(RpcClient.java:608)     at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.requestToServer(NamingGrpcClientProxy.java:203)     ... 9 common frames omitted

nacos github项目上确实有人提出nacos-2.0.1版本出现过类似的问题,但是我们遇到的情况跟这个不是太一样,最终发现出现这个问题的原因在于ip地址的冲突,又看了部署在其他两个节点的服务nacos-client客户端没有抛出上面的异常信息。于是修改对应的ip后就没有上述异常信息抛出了。

发现ip地址冲突可以通过arping命令实现:

0 人点赞