将Zookeeper与Solr一起使用,但只有2个服务器 [英] Using Zookeeper with Solr but only have 2 servers

查看:291
本文介绍了将Zookeeper与Solr一起使用,但只有2个服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Solr的新手,正在尝试SolrCloud-似乎ZooKeeper是管理高可用性的最佳方法.

I am new to Solr and am experimenting with SolrCloud - and it seems that ZooKeeper is the best way to manage high availability.

但是,在我们的生产环境中,我们只有两台服务器(主动-主动),并且我担心Zookeeper在两台服务器上并不理想,因为如果其中任何一台崩溃,整个系统就会停止工作.到目前为止,解决方法是在server1上运行两个ZK,在server2上运行一个ZK,这样至少在server2发生故障时,我们仍然具有仲裁(但是,如果server1发生故障,则游戏结束).

However, in our production environment we only have two servers (active-active) and I am concerned that Zookeeper is not ideal on two servers because if either of them goes down the whole ensemble stops working. The workaround so far is to run two ZKs on server1 and one ZK on server2, so that at least if server2 goes down we still have quorum (but if server1 goes down, game over).

在这种情况下,Solr的最佳实践/推荐解决方案是什么?是否可以在不使用Zookeeper的情况下通过SolrCloud在2个服务器之间自动复制/故障转移?还是有某种方法可以使用Zookeeper(或其他工具?),使其在2台服务器上具有强大的功能?还是我必须回到使用传统模式复制?

What is the best practice / recommended solution for Solr in this scenario? Can it automatically replicate/fail over with SolrCloud between 2 servers without using zookeeper? Or is there some way to use Zookeeper (or another tool?) so that it is robust over 2 servers? Or do I have to go back to using the legacy-mode replication?

谢谢!

推荐答案

您将需要两台以上的服务器.生产型Zookeeper合奏至少需要3个实例,并且应始终为奇数:

You are going to need more than 2 servers. A production Zookeeper ensemble needs at least 3 instances and should always be an odd number:

三台ZooKeeper服务器是建议的最小尺寸 集成,我们还建议它们在单独的计算机上运行.

Three ZooKeeper servers is the minimum recommended size for an ensemble, and we also recommend that they run on separate machines.

要获得可靠的ZooKeeper服务,您应该在以下位置部署ZooKeeper: 集群称为合奏.只要多数合奏 启动,该服务将可用.因为Zookeeper需要一个 大多数情况下,最好使用奇数台机器.例如, 四台机器的ZooKeeper只能处理单个故障 机器;如果两台机器发生故障,其余两台机器不会 占多数.但是,使用五台机器,ZooKeeper可以 处理两台机器的故障.

For reliable ZooKeeper service, you should deploy ZooKeeper in a cluster known as an ensemble. As long as a majority of the ensemble are up, the service will be available. Because Zookeeper requires a majority, it is best to use an odd number of machines. For example, with four machines ZooKeeper can only handle the failure of a single machine; if two machines fail, the remaining two machines do not constitute a majority. However, with five machines ZooKeeper can handle the failure of two machines.

http://zookeeper.apache.org/doc/r3.1.2/zookeeperAdmin.html

在1台服务器上运行2个实例并不能真正削减它,因为丢失该服务器将杀死群集. Solr Cloud需要Zookeeper-您无法解决它.

Running 2 instances on 1 server doesn't really cut it, as losing that server will kill the cluster. Solr Cloud requires Zookeeper - you can't get around it.

设置外部ZooKeeper集成

尽管Solr与Apache ZooKeeper捆绑在一起,但您应该考虑 您不希望在生产中使用此内部ZooKeeper, 因为关闭冗余的Solr实例也会关闭 它的ZooKeeper服务器,它可能没有那么多冗余.因为一个 ZooKeeper集合的法定人数必须超过其一半的服务器 在任何给定时间运行,这可能是一个问题.

Although Solr comes bundled with Apache ZooKeeper, you should consider yourself discouraged from using this internal ZooKeeper in production, because shutting down a redundant Solr instance will also shut down its ZooKeeper server, which might not be quite so redundant. Because a ZooKeeper ensemble must have a quorum of more than half its servers running at any given time, this can be a problem.

此问题的解决方案是设置一个外部ZooKeeper 合奏.

The solution to this problem is to set up an external ZooKeeper ensemble.

https://cwiki.apache. org/confluence/display/solr/Setting + Up + an + External + ZooKeeper + Ensemble

通常来说,尝试使用少于3台服务器运行真正的分布式大规模处理是一个坏主意-Zookeeper并非唯一,因为如果服务器发生故障,至少需要3台服务器才能支持可靠的操作.通常,您需要有一定数量的生存服务器(N/2 + 1)才能正常运行,因此至少需要从3个开始.

Generally speaking trying to run truly distributed, large scale processing with less than 3 servers is a bad idea - Zookeeper is not unique in it's requirement for at least 3 servers to support reliable operation if a server fails. Generally you need a quorum of surviving servers (N/2+1) to function, so you need to start with at least 3.

这篇关于将Zookeeper与Solr一起使用,但只有2个服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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