【发布时间】:2017-12-07 18:26:02
【问题描述】:
我的 spring boot 2.0 应用程序在 bootstrap.yml 中有以下条目 如果我使用配置文件 stage4 运行,则会加载配置值,即无法从 localhost1 启动。
如果我使用开发配置文件运行,这些值将被忽略,即 consul 以 localhost 开头,而不是 localhost2 失败。任何指针?
spring:
profiles: dev
cloud:
consul:
host: localhost2
port: 8500
config:
prefix: config
defaultContext: myapp/dev
spring:
profiles: stage
cloud:
consul:
host: localhost1
port: 8500
config:
prefix: config
defaultContext: myapp/stage
【问题讨论】:
标签: spring config profile consul