Apache Zookeeper:跨数据中心的节点分布 [英] Apache Zookeeper: distribution of nodes across data centers

查看:71
本文介绍了Apache Zookeeper:跨数据中心的节点分布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发全新的SolrCloud-ZooKeeper基础结构.

I am working on a brand new SolrCloud - ZooKeeper infrastructure.

一些背景信息:

  • 所有其他服务(主要是网站基础结构)分布在具有 active-active 配置的两个数据中心中.
  • 在网络级别,服务器安装在扩展的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.

Nic

推荐答案

很久以前,但还是让我们分享一下我所做的事情.

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次失败.那是在第三办公室,而不是在华盛顿特区.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆