nacos registry, gateway register failed java.lang.IllegalArgumentException: no server available

今天再试谷粒商城的项目时将gateway网关注册到nacos时报错了,不能将服务注册上去

报错如下:

nacos registry, gateway register failed java.lang.IllegalArgumentException: no server available_第1张图片

nacos registry, gateway register failed java.lang.IllegalArgumentException: no server available_第2张图片 查找了资料才发现是nacos的配置写法有问题

在application.properties中要怎么写:

#spring.cloud.nacos.config.server-addr=127.0.0.1:8848
spring.application.name=gulimail-gateway
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
server.port=88

 在 bootstrap.properties中这么写:

spring.cloud.nacos.config.namespace=6f116dcb-b75a-49b0-ad14-ad4f557239cc
spring.cloud.nacos.config.server-addr=127.0.0.1:8848
spring.application.name=gulimail-gateway

然后就成功注册上去了

你可能感兴趣的:(SpringCloud,java,gateway,spring)