使用config配置中心后,eureka 出现 unknown

bootstrap.yml

# 服务注册中心
eureka:
  instance:
    prefer-ip-address: true
    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
  client:
    service-url:
      defaultZone: http://${REGISTRY_SERVER_USERNAME}:${REGISTRY_SERVER_PASSWORD}@hy-registry:8761/eureka/
    healthcheck:
      enabled: true # 开启健康检查

将eureka.client.healthcheck.enabled=true注释掉,重启服务,ok,一切正常了!

eureka.client.healthcheck.enabled=true should only be set in application.yml. Setting the value in bootstrap.yml causes undesirable side effects, such as registering in Eureka with an UNKNOWN status.
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_43577800/article/details/86478641
今日推荐