我正在运行 Spring Cloud Brixton SR3 - Spring Netflix Eureka、Spring Cloud Config 和 Discovery Client 应用程序。当客户端应用程序配置为
eureka.client.healthcheck.enabled=true 和 spring.cloud.config.discovery.enabled=true
该应用程序启动时在 Eureka 注册,状态为“UNKNOWN”,并且永远不会更改为“UP”。如果这些标志中的任何一个设置为 false,则应用程序启动时注册为“UP”。
当两个标志都启用/为真时,我会看到这一系列日志记录:
2016-07-13 17:41:38.144 INFO 13180 --- [ main] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1468456898144, current=UP, previous=STARTING]
2016-07-13 17:41:38.144 DEBUG 13180 --- [nfoReplicator-0] c.n.discovery.InstanceInfoReplicator : Executing on-demand update of local InstanceInfo
2016-07-13 17:41:38.144 DEBUG 13180 --- [nfoReplicator-0] c.n.discovery.InstanceInfoReplicator : Canceling the latest scheduled update, it will be rescheduled at the end of on demand update
2016-07-13 17:41:38.145 INFO 13180 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient : Saw local status change event StatusChangeEvent [timestamp=1468456898145, current=UNKNOWN, previous=UP]
如何让应用注册为 UP 并启用/为真这两个标志?
引导程序.yml
spring:
application:
name: hello-brixton
# Spring Cloud Config
cloud:
config:
name: hello-brixton
discovery:
enabled: true
serviceId: config-service
eureka:
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: ${SERVICE_REGISTRY_URL:http://localhost:8080/eureka/}
healthcheck:
enabled: true