SpringCloud(3) Config统一配置中心

config会从git拉取配置文件到本地,然后读取本地文件

eureka:
  client:
    service-url:
      #注册服务端地址
      defaultZone: http://localhost:8761/eureka
spring:
  application:
    name: config
  cloud:
    config:
      server:
        git:
          #配置文件git地址
          uri: https://gitee.com/yejiaomin/config-repo
          #git用户名密码
          username: xxxx
          password: yyyyy
          #git文件保存本地地址
          basedir: D:\2.workspace\config\basedir

1.读取配置文件格式

/{name}-{profiles}.yml

/{label}/{name}-{profiles}.yml

name 服务名, profiles:环境,label: 分支

http://localhost:8080/release/order-dev.yml

猜你喜欢

转载自www.cnblogs.com/t96fxi/p/12694307.html
今日推荐