我需要在配置服务器上添加两个配置仓库。但是,它只选择一个配置库。谁能帮我解决这个问题。
配置服务器 bootstrap.yml
server:
port: 8899
spring:
cloud:
config:
server:
git:
uri: https://github.com/pocuser9x/wednest-config-store
search-paths:
- 'wednest-config-store/*service'
repos:
uri: https://github.com/pocuser9x/secure-config-store
在 https:/github.compocuser9xwednest-config-store。 我有以下文件
event-service.yml
event-service-dev.yml
event-service-stg.yml
这些文件是正确的挑选。
在 https:/github.compocuser9xsecure-config-store。 我有以下文件event-service-prod.yml
这个文件没有被选中。
我想你要找的是复合仓库功能。它被记录在案 此处.
对你来说,这将是类似的东西。
spring:
profiles:
active: composite
cloud:
config:
server:
composite:
-
type: git
uri: https://github.com/pocuser9x/wednest-config-store
search-paths:
'wednest-config-store/*service'
-
type: git
uri: https://github.com/pocuser9x/secure-config-store
有一点需要注意的是,文档中的配置文件设置如上所述 但我发现需要使用 "include "而不是 "active"。Include是加法。
profiles:
include: composite