【问题标题】:Are multiple GIt hosts in the Spring Cloud config server possible?Spring Cloud 配置服务器中是否有多个 GIt 主机?
【发布时间】:2019-02-10 15:37:24
【问题描述】:

由于最近 Microsoft 的 Azure 服务中断,我们的团队正在集思广益,为我们的应用程序增加冗余和容错能力。

在Spring.IO 的文档中,有多种方法可以同时使用 Git、SVN 或 vault,但我对使用两个 Git 主机感兴趣。

设置 Composite 配置文件可能是我想要的,但听起来好像我试图覆盖所有列出的存储库中的值并且我正在寻找一个完整的故障转移选项。

我的用例是如何配置配置服务器,以便在主机出现故障并且我们无法检索配置文件以故障转移到第二个 GIT 主机时。

这可能吗?配置会是什么样子?

我的猜测是这样的排序。

  spring:
    profiles:
      cloud:
        config:
          server:
            git:
              uri: bitbucket.com
              order: 1
            git:
              uri: github.com
              order: 1

【问题讨论】:

    标签: spring configuration config spring-cloud spring-cloud-config


    【解决方案1】:

    答案是使用composite feature:

    spring:
      profiles:
        active: composite
      cloud:
        config:
          server:
            composite:
            -
              type: git
              uri: file:///path/to/rex/git/repo
            -
              type: git
              uri: file:///path/to/walter/git/repo
    

    【讨论】:

      猜你喜欢
      • 2019-05-15
      • 2017-09-07
      • 2017-07-25
      • 2023-03-24
      • 1970-01-01
      • 2020-04-16
      • 2021-09-20
      • 2018-08-24
      • 2016-02-15
      相关资源
      最近更新 更多