开发者社区 > 云原生 > 正文

nacos集群,重启网络后程序报错

之前是正常的,使用了service network restart 命令重启网络后,程序会报错,如下:

Describe the bug [2021-09-09 17:14:16.734 PM] 172.22.1.135 cngc-cloud-application ERROR ,, com.alibaba.nacos.naming.beat.sender com.alibaba.nacos.client.naming [CLIENT-BEAT] failed to send beat: {"cluster":"DEFAULT","ip":"172.22.1.135","metadata":{"preserved.register.source":"SPRING_CLOUD"},"period":5000,"port":8098,"scheduled":false,"serviceName":"DEFAULT_GROUP@@cngc-cloud-application","stopped":false,"weight":1.0} java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance/beat after all servers([nacos-headless:8848]) tried: failed to req API:nacos-headless:8848/nacos/v1/ns/instance/beat. code:500 msg: java.net.SocketTimeoutException: connect timed out at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:464) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:386) at com.alibaba.nacos.client.naming.net.NamingProxy.sendBeat(NamingProxy.java:309) at com.alibaba.nacos.client.naming.beat.BeatReactor$BeatTask.run(BeatReactor.java:92) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [2021-09-09 17:14:24.799 PM] 172.22.1.135 cngc-cloud-application WARN ,, com.alibaba.nacos.client.naming.updater com.alibaba.nacos.client.naming failed to request http://nacos-headless:8848/nacos/v1/ns/instance/list?healthyOnly=false&namespaceId=cngc-cloud-seata&clientIP=172.22.1.135&serviceName=SEATA_GROUP%40%40seata-server&udpPort=54328&encoding=UTF-8&clusters=default from 172.23.14.205 [2021-09-09 17:14:24.799 PM] 172.22.1.135 cngc-cloud-application ERROR ,, com.alibaba.nacos.client.naming.updater com.alibaba.nacos.client.naming [NA] failed to request java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:607) at sun.net.NetworkClient.doConnect(NetworkClient.java:175) at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) at sun.net.www.http.HttpClient.(HttpClient.java:242) at sun.net.www.http.HttpClient.New(HttpClient.java:339) at sun.net.www.http.HttpClient.New(HttpClient.java:357) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1226) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:990) at com.alibaba.nacos.client.naming.net.HttpClient.request(HttpClient.java:89) at com.alibaba.nacos.client.naming.net.NamingProxy.callServer(NamingProxy.java:410) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:451) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:386) at com.alibaba.nacos.client.naming.net.NamingProxy.queryList(NamingProxy.java:297) at com.alibaba.nacos.client.naming.core.HostReactor.updateServiceNow(HostReactor.java:270) at com.alibaba.nacos.client.naming.core.HostReactor$UpdateTask.run(HostReactor.java:315) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [2021-09-09 17:14:24.801 PM] 172.22.1.135 cngc-cloud-application ERROR ,, com.alibaba.nacos.client.naming.updater com.alibaba.nacos.client.naming request nacos-headless:8848 failed. com.alibaba.nacos.api.exception.NacosException: failed to req API:nacos-headless:8848/nacos/v1/ns/instance/list. code:500 msg: java.net.SocketTimeoutException: connect timed out at com.alibaba.nacos.client.naming.net.NamingProxy.callServer(NamingProxy.java:424) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:451) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:386) at com.alibaba.nacos.client.naming.net.NamingProxy.queryList(NamingProxy.java:297) at com.alibaba.nacos.client.naming.core.HostReactor.updateServiceNow(HostReactor.java:270) at com.alibaba.nacos.client.naming.core.HostReactor$UpdateTask.run(HostReactor.java:315) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [2021-09-09 17:14:24.801 PM] 172.22.1.135 cngc-cloud-application ERROR ,, com.alibaba.nacos.client.naming.updater com.alibaba.nacos.client.naming [NA] failed to update serviceName: SEATA_GROUP@@seata-server java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance/list after all servers([nacos-headless:8848]) tried: failed to req API:nacos-headless:8848/nacos/v1/ns/instance/list. code:500 msg: java.net.SocketTimeoutException: connect timed out at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:464) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:386) at com.alibaba.nacos.client.naming.net.NamingProxy.queryList(NamingProxy.java:297) at com.alibaba.nacos.client.naming.core.HostReactor.updateServiceNow(HostReactor.java:270) at com.alibaba.nacos.client.naming.core.HostReactor$UpdateTask.run(HostReactor.java:315) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [2021-09-09 17:14:37.804 PM] 172.22.1.135 cngc-cloud-application WARN ,, com.alibaba.nacos.client.naming.updater com.alibaba.nacos.client.naming failed to request http://nacos-headless:8848/nacos/v1/ns/instance/list?healthyOnly=false&namespaceId=cngc-cloud-seata&clientIP=172.22.1.135&serviceName=SEATA_GROUP%40%40seata-server&udpPort=54328&encoding=UTF-8&clusters=default from 172.23.14.205 [2021-09-09 17:14:37.804 PM] 172.22.1.135 cngc-cloud-application ERROR ,, com.alibaba.nacos.client.naming.updater com.alibaba.nacos.client.naming [NA] failed to request java.net.SocketTimeoutException: connect timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:607) at sun.net.NetworkClient.doConnect(NetworkClient.java:175) at sun.net.www.http.HttpClient.openServer(HttpClient.java:463) at sun.net.www.http.HttpClient.openServer(HttpClient.java:558) at sun.net.www.http.HttpClient.(HttpClient.java:242) at sun.net.www.http.HttpClient.New(HttpClient.java:339) at sun.net.www.http.HttpClient.New(HttpClient.java:357) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1226) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1162) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:990) at com.alibaba.nacos.client.naming.net.HttpClient.request(HttpClient.java:89) at com.alibaba.nacos.client.naming.net.NamingProxy.callServer(NamingProxy.java:410) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:451) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:386) at com.alibaba.nacos.client.naming.net.NamingProxy.queryList(NamingProxy.java:297) at com.alibaba.nacos.client.naming.core.HostReactor.updateServiceNow(HostReactor.java:270) at com.alibaba.nacos.client.naming.core.HostReactor$UpdateTask.run(HostReactor.java:315) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [2021-09-09 17:14:37.804 PM] 172.22.1.135 cngc-cloud-application ERROR ,, com.alibaba.nacos.client.naming.updater com.alibaba.nacos.client.naming request nacos-headless:8848 failed. com.alibaba.nacos.api.exception.NacosException: failed to req API:nacos-headless:8848/nacos/v1/ns/instance/list. code:500 msg: java.net.SocketTimeoutException: connect timed out at com.alibaba.nacos.client.naming.net.NamingProxy.callServer(NamingProxy.java:424) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:451) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:386) at com.alibaba.nacos.client.naming.net.NamingProxy.queryList(NamingProxy.java:297) at com.alibaba.nacos.client.naming.core.HostReactor.updateServiceNow(HostReactor.java:270) at com.alibaba.nacos.client.naming.core.HostReactor$UpdateTask.run(HostReactor.java:315) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) [2021-09-09 17:14:37.804 PM] 172.22.1.135 cngc-cloud-application ERROR ,, com.alibaba.nacos.client.naming.updater com.alibaba.nacos.client.naming [NA] failed to update serviceName: SEATA_GROUP@@seata-server java.lang.IllegalStateException: failed to req API:/nacos/v1/ns/instance/list after all servers([nacos-headless:8848]) tried: failed to req API:nacos-headless:8848/nacos/v1/ns/instance/list. code:500 msg: java.net.SocketTimeoutException: connect timed out at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:464) at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:386) at com.alibaba.nacos.client.naming.net.NamingProxy.queryList(NamingProxy.java:297) at com.alibaba.nacos.client.naming.core.HostReactor.updateServiceNow(HostReactor.java:270) at com.alibaba.nacos.client.naming.core.HostReactor$UpdateTask.run(HostReactor.java:315) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

客户端:springCloud 2.X 服务端:1.4.2 接入方式:k8s-nacos,参考的官网k8s的方式安装

原提问者GitHub用户ai641843909

展开
收起
学习娃 2023-05-22 16:18:09 652 0
1 条回答
写回答
取消 提交回答
  • 1.手动访问一下报错api看看是否报错

    2.k8s集群中的应用有没有暴露在外部网络

    3.查看该pod所在主机这个端口是否可以访问 curl -v http://$POD_IP:端口/ping 暴露服务的方式可参考 https://juejin.cn/post/6844903654391021581

    原回答者GitHub用户li-xiao-shuang

    2023-05-23 09:38:34
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关电子书

更多
Nacos架构&原理 立即下载
workshop专场-微服务专场-开发者动手实践营-微服务-使用Nacos进行服务的动态发现和流量调度 立即下载
Nacos 启航,发布第一个版本, 云原生时代助力用户微服务平台建设 立即下载