spring - Spring Cloud 配置服务器中是否有多个 GIt 主机?
问题描述
由于最近 Microsoft 的 Azure 服务中断,我们的团队正在集思广益,为我们的应用程序添加冗余和容错。
在Spring.IO的文档中,有多种方法可以一起使用 Git、SVN 或 vault,但我对使用两个 Git 主机感兴趣。
设置复合配置文件可能是我正在寻找的东西,但这听起来像是我试图覆盖所有列出的存储库中的值并且我正在寻找一个完整的故障转移选项。
我的用例是如何配置配置服务器,以便如果主机出现故障并且我们无法检索配置文件以故障转移到我们的第二个 GIT 主机。
这可能吗?配置会是什么样子?
我的猜测是这样的订购。
spring:
profiles:
cloud:
config:
server:
git:
uri: bitbucket.com
order: 1
git:
uri: github.com
order: 1
解决方案
答案是使用复合特征:
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
推荐阅读
- jmeter - 如何从 Jason 响应中检索号码
- php - 如何手动命名 Laravel 迁移以便“php artisan migrate”可以运行?
- java - 提供自定义信任库时,Maven 不使用系统密钥库
- batch-file - 如何使用 Windows 批处理脚本捕获网页上包含的地址链接?
- ruby-on-rails - 带有活动存储的 Rails 计数器缓存
- android - com.crystal.crystalrangeseekbar.widgets.BubbleThumbRangeSeekbar:右侧和拇指图像的问题
- java - 如果从 Spring Boot + Spring Data JPA + Hibernate 连接到 Oracle 时出现连接错误,将在哪里记录/显示错误?
- asp.net - 通过 asp.net core webapi 从 Google Storage 文件中提供文件
- c# - 从 Sql 列中的值中减去 DateTime.Now
- javascript - 反应表出现问题类型错误:无法读取未定义的属性“forEach”