昨天學springcloud,然后出了這么一個異常,
最后發現是只配置了Eureka的service的application.yml文件,但是我把Eureka的client的application文件給忘了。
最后如下:service
server:
port: 7001
eureka:
instance:
hostname: localhost
client:
register-with-eureka: false
fetch-registry: false
service-url:
defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
client
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:7001/eureka/