Spring Cloud Config 分布式配置中心
配置文件的命名方式:{application}-{profile}.yml或{application}-{profile}.properties
application为应用名称
profile用于区分开发环境,测试环境,生产环境等
如user-dev.yml表示用户微服务开发环境下使用的配置文件。
spring:
cloud:
config:
#与远程仓库中的配置文件的application保持一致
name: user
# 远程仓库中的配置文件的profile保持一致
profile: dev
# 远程仓库中的版本保持一致
label: master
discovery:
#使用配置中心
enabled: true
#配置中心服务id
service-id: config-server
eureka:
client:
service-url:
defaultZone: http://127.0.0.1:10086/eureka