Are multiple GIt hosts in the Spring Cloud config

2019-05-31 13:00发布

With the recent outage of Microsoft's Azure Services our team is brain storming ways to add redundancy and fault tolerance to our apps.

In the documentation on Spring.IO there are multiple ways of using Git, SVN, or vault together but Im interested in using Two Git host.

setting the Composite profile maybe what Im looking for but that sounds like if I'm trying to override values from all the repositories listed and Im looking for a complete fail-over option.

My use case is how to configure the config server so that if a host goes down and we cannot retrieve our config file to fail over to our second GIT host.

IS this possible and what would the configuration look like?

My guess is something like this with ordering.

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

1条回答
Ridiculous、
2楼-- · 2019-05-31 13:47

The answer is to use the 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
查看更多
登录 后发表回答