springboot项目启动报错

ERROR com.alibaba.nacos.client.config.http.ServerHttpAgent.httpGet(ServerHttpAgent.java:108) : [NACOS ConnectException httpGet] currentServerAddr:http://localhost:8848, err : Connection refused (Connection refused)

解决方法

配置application.properties

spring.cloud.nacos.discovery.server-addr=xxx.xxx.xxx.xxx:8848
spring.application.name=服务名

配置bootstrap.properties

#nacos config
spring.cloud.nacos.config.server-addr=xxx.xxx.xxx.xxx:8848
spring.application.name=服务名

参考:https://www.cnblogs.com/chenyanbin/p/13680264.html