原因:
一、没有导入Nacos配置中心依赖,或版本过高
配置中心依赖
com.alibaba.cloud spring-cloud-starter-alibaba-nacos-config
之前的版本配置,结果启动失败
SpringBoot 2.4.2
SpringCloudAlibaba 2021.1
更改后【官方参考】
SpringBoot 2.3.2.RELEASE
SpringCloudAlibaba 2.2.6.RELEASE
二、没有开启Nacos
进入nacos目录下的bin,执行startup.cmd或startup.sh,独立部署需要加 standalone参数,集群部署直接运行
三、Nacos服务器负载过高【这个还没遇到,先记上】
删掉nacos文件夹下的data文件夹,重新启动


![Nacos报错:failed to req API:/nacos/v1/ns/instance after all servers([localhost:8848] Nacos报错:failed to req API:/nacos/v1/ns/instance after all servers([localhost:8848]](http://www.mshxw.com/aiimages/31/877105.png)
