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

spring cloud gateway 配置了nacos 的server-addr,但是一直尝试连

server: port: 8080 spring: application: name: spike-gateway cloud:

gateway:

discovery:

locator:

enabled: true

nacos:
  discovery:
    server-addr: 192.168.182.79:8848

上面我明明配置了server-add 为服务器地址的nacos;也成功连上了服务器的nacos; 但是控制台却一直打印本地连接,从服务启动便开始连接本地的nacos地址;

2020-07-24 14:48:20.590 ERROR 68812 --- [-localhost_8848] c.a.n.c.config.http.ServerHttpAgent : [NACOS ConnectException httpPost] currentServerAddr: http://localhost:8848, err : Connection refused 2020-07-24 14:48:20.591 ERROR 68812 --- [-localhost_8848] c.a.n.client.config.impl.ClientWorker : [fixed-localhost_8848] [check-update] get changed dataId exception

java.net.ConnectException: [NACOS HTTP-POST] The maximum number of tolerable server reconnection errors has been reached at com.alibaba.nacos.client.config.http.ServerHttpAgent.httpPost(ServerHttpAgent.java:170) ~[nacos-client-1.2.1.jar:na] at com.alibaba.nacos.client.config.http.MetricsHttpAgent.httpPost(MetricsHttpAgent.java:64) ~[nacos-client-1.2.1.jar:na] at com.alibaba.nacos.client.config.impl.ClientWorker.checkUpdateConfigStr(ClientWorker.java:386) [nacos-client-1.2.1.jar:na] at com.alibaba.nacos.client.config.impl.ClientWorker.checkUpdateDataIds(ClientWorker.java:354) [nacos-client-1.2.1.jar:na] at com.alibaba.nacos.client.config.impl.ClientWorker$LongPollingRunnable.run(ClientWorker.java:521) [nacos-client-1.2.1.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_45] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_45] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_45] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]

2020-07-24 14:48:20.591 ERROR 68812 --- [-localhost_8848] c.a.n.client.config.impl.ClientWorker : longPolling error :

java.net.ConnectException: [NACOS HTTP-POST] The maximum number of tolerable server reconnection errors has been reached at com.alibaba.nacos.client.config.http.ServerHttpAgent.httpPost(ServerHttpAgent.java:170) ~[nacos-client-1.2.1.jar:na] at com.alibaba.nacos.client.config.http.MetricsHttpAgent.httpPost(MetricsHttpAgent.java:64) ~[nacos-client-1.2.1.jar:na] at com.alibaba.nacos.client.config.impl.ClientWorker.checkUpdateConfigStr(ClientWorker.java:386) ~[nacos-client-1.2.1.jar:na] at com.alibaba.nacos.client.config.impl.ClientWorker.checkUpdateDataIds(ClientWorker.java:354) ~[nacos-client-1.2.1.jar:na] at com.alibaba.nacos.client.config.impl.ClientWorker$LongPollingRunnable.run(ClientWorker.java:521) ~[nacos-client-1.2.1.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_45] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_45] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_45] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]

希望能得到解答,具体是什么原因导致的

原提问者GitHub用户ZhuoSir

展开
收起
白夜行fighting 2023-06-11 10:00:56 141 0
1 条回答
写回答
取消 提交回答
  • 你应该是引入了nacos-config的依赖,如果没有使用动态配置那就移出就行了。

    原回答者GitHub用户yuhuangbin

    2023-06-11 11:14:18
    赞同 展开评论 打赏

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

相关电子书

更多
Spring Cloud 微服务核心组件集 mica 的设计思路 立即下载
workshop专场-微服务专场-开发者动手实践营-微服务-Spring Cloud Alibaba 微服务全家桶体验 立即下载
云栖社区特邀专家徐雷Java Spring Boot开发实战系列课程(第20讲):经典面试题与阿里等名企内部招聘求职面试技巧 立即下载

相关实验场景

更多