简体   繁体   English

Spring Cloud Config Config Server - 多个实例之间的同步

[英]Spring Cloud Config Config Server - Synchronization between several instances

Let's say I have started to use the spring-cloud-config-server and get it working (using a git repository in background).假设我已经开始使用 spring-cloud-config-server 并使其正常工作(在后台使用 git 存储库)。 So now I will deploy that config-server on a cluster (mesos cluster or AWS cloud etc.)所以现在我将在集群(mesos 集群或 AWS 云等)上部署该配置服务器

So for reliability etc. I would like to start two instances of the same config-service within a cluster.所以为了可靠性等,我想在一个集群中启动同一个配置服务的两个实例。 By using a service registry all other services can now connect to that config-server and get their configuration.通过使用服务注册表,所有其他服务现在都可以连接到该配置服务器并获取它们的配置。

But the question: How can the synchronisation between those config-servers being handled... So for example If I change the configuration in the git repository and now there is some lack of time between both instance will deliver the exact same information...但问题是:如何处理这些配置服务器之间的同步……例如,如果我更改了 git 存储库中的配置,现在两个实例之间的时间不足,将提供完全相同的信息……

Does there exist a solution for that ?是否存在解决方案? Some kind of a raft census protocol / setup etc. ?某种筏式人口普查协议/设置等? Or is there the only solution not to use spring-config-server and use etcd instead or other solutions ?或者是否有唯一的解决方案不使用 spring-config-server 而使用 etcd 或其他解决方案?

Update: It might be an option to make a fore-update option for the git repositories.更新:这可能是为 git 存储库制作前更新选项的一个选项。 This makes sure to get the most recent state with the drawback of performance.这确保获得最新的状态,但会降低性能。

In Spring Cloud Services v3.1.2 and later, you can use the periodic parameter when configuring a Config Server service instance to cause the mirror service to automatically refresh a Git repository mirror periodically在Spring Cloud Services v3.1.2及以后版本中,可以在配置Config Server服务实例时使用periodic参数,使镜像服务定期自动刷新Git仓库镜像

pcf link 链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM