gpt4 book ai didi

solr - 将 Zookeeper 与 Solr 一起使用,但只有 2 台服务器

转载 作者:行者123 更新时间:2023-12-04 19:49:30 26 4
gpt4 key购买 nike

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

但是,在我们的生产环境中,我们只有两台服务器(主动-主动),我担心 Zookeeper 在两台服务器上并不理想,因为如果其中任何一个出现故障,整个集成都将停止工作。到目前为止的解决方法是在 server1 上运行两个 ZK,在 server2 上运行一个 ZK,这样至少如果 server2 出现故障,我们仍然有法定人数(但如果 server1 出现故障,游戏结束)。

在这种情况下,Solr 的最佳实践/推荐解决方案是什么?它可以在不使用 Zookeeper 的情况下在两台服务器之间使用 SolrCloud 自动复制/故障转移吗?或者有什么方法可以使用 Zookeeper(或其他工具?),使其在 2 台服务器上更加强大?还是我必须重新使用传统模式复制?

谢谢!

最佳答案

您将需要 2 台以上的服务器。生产 Zookeeper ensemble 至少需要 3 个实例,并且应该始终是奇数:

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

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 - 你无法绕过它。

Setting Up an External ZooKeeper Ensemble

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.

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 个开始。

关于solr - 将 Zookeeper 与 Solr 一起使用,但只有 2 台服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24694296/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com