Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 向Spring云配置服务器添加多个存储库_Spring Boot_Spring Cloud_Spring Cloud Config Server - Fatal编程技术网

Spring boot 向Spring云配置服务器添加多个存储库

Spring boot 向Spring云配置服务器添加多个存储库,spring-boot,spring-cloud,spring-cloud-config-server,Spring Boot,Spring Cloud,Spring Cloud Config Server,我需要向配置服务器添加两个配置存储库。但是,它只选择一个配置存储库。谁能帮我解决这个问题 Config Server bootstrap.yml server: port: 8899 spring: cloud: config: server: git: uri: https://github.com/pocuser9x/wednest-config-store search-paths: - 'wednest-config-stor

我需要向配置服务器添加两个配置存储库。但是,它只选择一个配置存储库。谁能帮我解决这个问题

Config Server 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
在我有以下文件

事件服务.yml
event-service-dev.yml
event service stg.yml

这些文件拾取正确

在我下面的文件
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”。包含是附加的

  profiles:
    include: composite

我认为你正在寻找的是复合回购功能。这是有案可查的

对您来说,这将类似于:

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”。包含是附加的

  profiles:
    include: composite

它似乎是…的复制品它似乎是…的复制品