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

相关推荐
一包烟电脑面前做一天7 天前
.NetCore下Ocelot + Nacos 实现负载均衡
nacos·负载均衡·.netcore·ocelot·ocelot集成nacos
一包烟电脑面前做一天9 天前
.NetCore 接入 Nacos,实现配置中心和服务注册
nacos·.netcore·服务注册发现·配置中心
草履虫建模11 天前
若依微服务一键部署(RuoYi-Cloud):Nacos/Redis/MySQL + Gateway + Robot 接入(踩坑与修复全记录)
redis·mysql·docker·微服务·云原生·nacos·持续部署
叁金Coder1 个月前
业务系统跳转Nacos免登录方案实践
前端·javascript·nginx·nacos
●VON1 个月前
重生之我在暑假学习微服务第七天《微服务之服务治理篇》
java·学习·微服务·云原生·nacos·架构·springcloud
linmoo19861 个月前
Spring AI 系列之二十八 - Spring AI Alibaba-基于Nacos的prompt模版
人工智能·spring·nacos·prompt·springai·springaialibaba·动态提示词
yh云想1 个月前
《微服务SpringCloud架构实践指南:从Nacos到Gateway的全面解析》
spring cloud·nacos·gateway·openfeign·filter
洛阳泰山2 个月前
Spring Boot 整合 Nacos 实战教程:服务注册发现与配置中心详解
java·spring boot·后端·nacos
玄辰星君2 个月前
【MAC】nacos 2.5.1容器docker安装
macos·docker·nacos