赞
踩
原因:
但如果没有配置eureka.client.serviceUrl.defaultZone,spring cloud 的eureka默认Eureka Server为:
http://localhost:8761/eureka/
解决:
即便是当前项目就是Eureka Server,也应该加上eureka.client.serviceUrl.defaultZone配置,配置的值为自己。
示例如:
server.port=8000
#spring boot2.0 之后使用 server.servlet.context-path 否则使用 server.context-path
#server.servlet.context-path=/eureka33
#spring cloud项目微服务的服务名
spring.application.name=eureka22
#是否将自己注册到Eureka Server上,默认为true
eureka.client.register-with-eureka=false
#是否从Eureka Server上获取注册信息,默认为true
eureka.client.fetch-registry=false
eureka.client.serviceUrl.defaultZone=http://localhost:8000/eureka/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。