当前位置:   article > 正文

Spring Cloud Eureka Server报错Connect to localhost:8761 timed out_localhost timedout

localhost timedout

原因:
但如果没有配置eureka.client.serviceUrl.defaultZone,spring cloud 的eureka默认Eureka Server为:

http://localhost:8761/eureka/
  • 1

解决:
即便是当前项目就是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/
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/983942
推荐阅读
相关标签
  

闽ICP备14008679号