Spring Cloud Config

Spring Cloud Config

服务端:一个集中化配置中心,可以是一个独立的服务,也可以注册到服务治理中心,它可以集中管理各个 微服务的配置; 作用原理是从某个地方读取(本地/云端)提供给其客户端作为配置;

客户端:作为一个服务端,通过读取Config的服务端来获取自己的配置文件;

服务端核心代码:

1,服务端配置

spring:

  cloud:

    config:

      server:

        git:
# 配置文件的git地址,如果需要密码,则需要配置用户名密码

          uri: https://gitee.com/varyu-program/config-repo

#          username: 18596103896

#          password: 95594597@Gavin
#          配置仓库的版本

#          default-label: master

你可能感兴趣的:(spring,微服务,java,spring,spring,cloud)