【发布时间】:2019-05-02 08:45:22
【问题描述】:
我正在尝试在 consul 中为我的微服务应用程序配置运行状况检查,该应用程序将在 docker 容器中运行。
为了将执行器健康检查配置为 consul,我尝试使用 ${server.address} 作为主机地址,但它给了我 docker 容器 ID。
这是 bootstrap.yml
spring:
cloud:
consul:
scheme: http
host: consul.service.consul
port: 8500
config:
format: YAML
prefix: apps
data-key: config
default-context: ${spring.application.name}
discovery:
health-check-path: /actuator/health
healthCheckInterval: 20s
scheme: http
enabled: true
address: ${server.address}
main:
allow-bean-definition-overriding: true
在本地没有 docker 时,它能够正确解析地址,但在远程使用 docker 时,它会返回容器 ID。
有什么建议吗?
【问题讨论】:
标签: spring-boot docker docker-machine spring-boot-actuator spring-cloud-config