我尝试设置spring云配置服务器,并使用github上提供的示例启动。 https://github.com/spring-cloud-samples/configserverSpring Cloud配置服务器excample - 在应用程序配置中覆盖
但是我对application.yml(https://github.com/spring-cloud-samples/configserver/blob/master/src/main/resources/application.yml)配置文件有些困惑。它是关于覆盖部分的配置文件'latice'
spring:
profiles: lattice
cloud:
config:
server:
overrides:
eureka:
client:
serviceUrl:
defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/
instance:
hostname: $\{CF_INSTANCE_IP:localhost}
nonSecurePort: $\{CF_INSTANCE_PORT:$\{PORT:$\{server.port:8080}}}
eureka:
instance:
hostname: ${CF_INSTANCE_IP:localhost}
nonSecurePort: ${CF_INSTANCE_PORT:${PORT:${server.port:8888}}}
client:
serviceUrl:
defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/
为什么需要覆盖?基本上它与以下尤里卡设置中定义的相同。 我也没有找到任何有关覆盖在文档中。
非常感谢您的帮助
干杯 弗洛里安
好问题,一目了然,关于覆盖属性的文档中没有任何内容出现。看看它的出现,它是一种覆盖客户端设置的方式。每个代码的评论:'额外的地图来源无条件地发送给所有客户' – code