currentServerAddr:http://localhost:8848, err : connect timed out

场景复现:

一:原配置文件application.yml

bash 复制代码
spring:
  cloud:
    nacos:
      config:
        server-addr: ${cas-wict-nacos-url}
        namespace: ${cas-wict-nacos-namespace}
        shared-configs:
          - data-id: mysql.properties
            refresh: true
          - data-id: mysql.properties
            refresh: true
          - data-id: job.properties
            refresh: true
      discovery:
        server-addr: ${cas-wict-nacos-url}
        namespace: ${cas-wict-nacos-namespace}
        cluster-name: failover
        metadata:
          protocol: rest

一直报错:currentServerAddr:http://localhost:8848, err : connect timed out

原因:老版本nacos一直优先读本地的bootstrap.properties, 导致application.yml的nacos没能读取到

解决办法:

新增一个bootstrap.properties配置,里面方nacos的配置

相关推荐
LoneEon17 小时前
CentOS7 部署 Nacos3.x 集群实战:从注册中心到 AI 管理中心
linux·人工智能·nacos
Thomas.Sir6 天前
第12课:Nacos 配置加密、版本回溯、配置监听 & 生产风控方案
spring cloud·nacos
Thomas.Sir7 天前
第11课:Nacos 多环境、多服务配置隔离 & 配置优先级详解
spring cloud·微服务·nacos
lisanmengmeng9 天前
nacos nrpe 监控机及被监控机部署
服务器·nacos·nagios·nrpe
欢醉17 天前
踩坑记:一次Nacos客户端偶发connect timed out全链路排查
nacos·springcloud
cnkeysky19 天前
SpringBoot 整合 nacos 配置中心
nacos·springboot
cnkeysky20 天前
docker 运行 nacos
docker·nacos
流烟默1 个月前
Sentinel 规则持久化到 Nacos 实践(网关篇 + 普通应用篇)
nacos·sentinel·规则持久化
LayZhangStrive1 个月前
后端开发中间件 - Nacos下载并快速使用教程
中间件·nacos
就叫_这个吧1 个月前
java springcloud熔断降级组件sentinel基础应用及nacos持久化处理
java·spring cloud·nacos·sentinel