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的配置

相关推荐
流烟默2 天前
从 Nacos 3.0.3 启动日志看架构演进:Server API 与 Console 分离实践
nacos·集群
我不会起名字3223 天前
服务注册了却调不通:注册中心与心跳的 3 个时间参数
微服务·nacos·注册中心·排查
2501_9339232510 天前
SpringCloud组件:Nacos服务注册快速入门
后端·spring·spring cloud·nacos
wangjialelele12 天前
一文梳理 Spring Cloud 核心组件:Eureka、Nacos、OpenFeign、LoadBalancer 与 Gateway
java·spring boot·spring·spring cloud·微服务·nacos
流烟默20 天前
网关 Sentinel 限流实战:API 分组、规则加载与全量匹配踩坑记
nacos·gateway·sentinel·流控规则
spencer_tseng20 天前
nacos CVE‑2021‑29441
nacos·alibaba
Joy T21 天前
Spring AI 项目中的 pom.xml、application.yml 与 Nacos:从依赖管理到运行配置
spring·nacos·pom.xml·profile·参数配置·application.yml
LoneEon22 天前
CentOS7 部署 Nacos3.x 集群实战:从注册中心到 AI 管理中心
linux·人工智能·nacos
Thomas.Sir1 个月前
第12课:Nacos 配置加密、版本回溯、配置监听 & 生产风控方案
spring cloud·nacos
Thomas.Sir1 个月前
第11课:Nacos 多环境、多服务配置隔离 & 配置优先级详解
spring cloud·微服务·nacos