Apache Zookeeper:跨数据中心的节点分布 [英] Apache Zookeeper: distribution of nodes across data centers
问题描述
我正在开发全新的 SolrCloud - ZooKeeper 基础架构.
I am working on a brand new SolrCloud - ZooKeeper infrastructure.
一些背景信息:
- 所有其他服务(主要是网站基础设施)分布在两个数据中心,采用主动-主动配置.
- 在网络级别,服务器设置在扩展 LANS 上,并在数据中心之间使用暗光纤.因此延迟最小.
- 大多数这些应用程序将使用 SolrCloud - ZooKeeper 基础架构.
我有一个 Solr Cloud 和一个 ZooKeeper 集合在运行.这个级别的实现很好.
I got a Solr Cloud, and a ZooKeeper ensemble running. Implementation at this level is fine.
但我想知道如何分发我的 ZooKeeper 服务器.我必须有奇数个服务器,但我只有 2 个数据中心.如果一个失败,我有 50-50 的机会失去多数.
But I wonder how to distribute my ZooKeeper servers. I must have an odd number of servers, but I only have 2 data centers. If one fails, I have a 50-50 chance that I will loose majority.
有什么想法吗?到目前为止我已经想到了:
Any ideas? So far I have thought of:
申请第三个数据中心(不太可能发生,$$$!)
requesting a third data center (not likely to happen, $$$!)
在每个数据中心托管 2 个,在外部云提供商(Amazon 或 ...?)上托管 1 个.再次$$
host 2 per data center and 1 on an external cloud provider (Amazon or ...?). Again $$$
在数据中心 1 设置一个奇数,并在站点 2 上使用观察者.如果站点 1 发生故障会发生什么?SolrCloud 可以只与 1 个观察者一起工作吗?
setup an odd number at data center 1 and use an observer on site 2. What then happens if site 1 fails? Can SolrCloud work with only 1 observer?
感谢您的任何想法和评论.
Thank you for any idea and comments.
尼克
推荐答案
很久以前,但仍然,让我们分享我所做的.
Long time ago, but still, lets share what I did.
我有第三个站点来托管另一个 ZooKeeper 实例.该站点是我公司的另一个办公室,而不是完整的 DC".所以每个站点有 1 个 ZK.
I got a third site to host the other ZooKeeper instance. This site is another office of my company, not a "full DC". So each site has 1 ZK.
让我将一个集群分布在 3 DC 上的原因是它们靠得足够近,可以在它们之间形成一条暗光纤.延迟非常低,不会影响 ZK 性能.
What allowed me to have one cluster spread over 3 DC is that they are close enough together to get a dark fiber between them. The latency is very low and does not impact ZK performance.
然后对于 SOLR,我在两个主要 DC 上获得了完整副本.第三个办公室只托管一个 ZK 以达到法定人数.使用完整副本,我拥有每个 DC 中的所有数据.如果以后我的SOLR需要增加,我会分片,但现在我们的索引很小.
Then for SOLR, I got full replicas on the two main DC. The 3rd office only hosts a ZK for quorum. Using full replicas, I have all the data in each DC. If my SOLR needs increase later, I will shard, but for now our index is small.
事实证明,它已经运行了 4 年,其中 1 次失败.而且是在第三个办公室,而不是在 DC.
It has proven solid for 4 years now, with 1 failure. And it was at the 3rd office, not in a DC.
这篇关于Apache Zookeeper:跨数据中心的节点分布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!