9.5.Config 多仓库配置
我们在Config Server的项目futurecloud-config-server来进行测试。
server:
port: 7000 #程序启动端口,也就是tomcat的端口
spring:
application:
name: futurecloud-config-server #应用名称,别名
cloud:
config:
server:
git:
uri: https://gitee.com/makyan/futurecloud-config # 默认访问路径
repos:
mtbdmp: #当访问mtbdmp时,使用以下url访问
rui: https://gitee.com/makyan/mtbdmp
futurecloud-base: #当访问的是,futurecloud-base,并且匹配以下规则时,请求以下uri
pattern: base*/dev*,*base*/test*
uri: https://gitee.com/makyan/futurecloud-base
local:
pattern: local*
uri: file:/home/configsvc/config-repo
test:
pattern:
- '*/development'
- '*/staging'
uri: https://github.com/makyan/test
配置文件说明:
mtbdmp 仓库自动匹配到 mtbdmp/*
futurecloud-base 仓库的pattern,第

本文详细介绍了Spring Cloud Config Server如何配置多仓库,指出Config Server在启动时会克隆第一个仓库,其他仓库按需克隆。同时,讲解了搜索路径(search-paths)的设置,配置文件需放在指定文件夹下,以及如何进行密码认证。通过示例展示了不同路径下的配置文件访问方式。
最低0.47元/天 解锁文章
167万+

被折叠的 条评论
为什么被折叠?



