简体   繁体   English

在2个节点的集群上运行zookeeper

[英]Running zookeeper on a cluster of 2 nodes

I am currently working on trying to use zookeeper in a two node cluster. 我目前正在尝试在双节点集群中使用zookeeper。 I have my own cluster formation algorithm running on the nodes based on configuration. 我根据配置在节点上运行自己的集群编队算法。 We only need Zookeeper's distributed DB functionality. 我们只需要Zookeeper的分布式数据库功能。

  1. Is it possible to use Zookeeper in a two node cluster ? 是否可以在双节点集群中使用Zookeeper? Do you know of any solutions where this has been done ? 你知道有任何解决方案吗?
  2. Can we still retain the zookeepers DB functionality without forming a quorum ? 我们是否仍然可以保留zookeepers数据库功能而不会形成法定人数?

Note: Fault tolerance is not the main concern in this project. 注意:容错不是此项目的主要关注点。 If one of the nodes go down we have enough code logic to run without the zookeeper service. 如果其中一个节点出现故障,我们就有足够的代码逻辑在没有zookeeper服务的情况下运行。 We use the zookeeper to share data when both the nodes are alive. 当两个节点都处于活动状态时,我们使用zookeeper来共享数据。

Would greatly appreciate any help. 非常感谢任何帮助。

Zookeeper is a coordination system which is basically used to coordinate among nodes. Zookeeper是一个协调系统,主要用于节点之间的协调。 When writes are occurred to such a distributed system, in ordered to coordinate and agree upon values which are being stored, all the writes are gone through master (aka leader) . 当对这样的分布式系统进行写入时,按顺序协调并同意存储的值,所有写入都通过master (aka leader) Reads can occur through any node. 读取可以通过任何节点进行。 Zookeeper requires a master/leader to be elected per a quorum in order to serve write requests consistently. Zookeeper要求每个法定人数选择一个主/领导者,以便始终如一地提供写请求。 Zookeeper make use of the ZAB protocol as the consensus algorithm. Zookeeper使用ZAB协议作为一致性算法。

  1. In order to elect a leader, a quorum should ideally have an odd number of nodes (Otherwise, a node will not be able to win majority and become the leader). 为了选举领导者,理论上法定数量的节点应该具有奇数个数(否则,节点将无法赢得多数并成为领导者)。 In your case, with two nodes, zookeeper will not possibly be able to elect a leader for a long time since both nodes will be candidates and wait for the other node to vote for it. 在你的情况下,有两个节点,zookeeper很可能不会长时间选出一个领导者,因为两个节点都是候选节点并等待另一个节点投票。 Even though they elect a leader, your ensemble will not work properly in network patitioning situations. 即使他们选出了领导者,你的合奏也无法在网络化的情况下正常运作。
  2. As I said, zookeeper is not a distributed storage. 正如我所说,zookeeper不是分布式存储。 If you need to use it in a distributed manner (more than one node), it need to form a quorum. 如果需要以分布式方式(多个节点)使用它,则需要形成仲裁。

As I see, what you need is a distributed database. 正如我所见,您需要的是分布式数据库。 Not a distributed coordination system. 不是分布式协调系统。

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

相关问题 Apache Zookeeper多节点集群未运行 - Apache Zookeeper multi-nodes cluster not running 具有两个节点的Zookeeper集群 - Zookeeper cluster with two nodes Zookeeper在两个节点上运行 - Zookeeper running on two nodes 使用偶数个节点运行zookeeper - Running zookeeper with even number of nodes Zookeeper的节点数是否与要监视的群集的节点数无关? - Is the number of nodes for Zookeeper independent of the number of nodes for cluster to be monitored? 新的3.5 Zookeeper节点似乎没有动态添加到我的集群中 - New 3.5 Zookeeper nodes do not appear to be dynamically added to my cluster 动物园管理员是否会在三个节点的集群中掉落一个节点后存活下来? - Is zookeeper survives after falling one node in a cluster of three nodes? Zookeeper-如果我仅将zk集群中的某些节点(集成)传递给连接字符串,将会发生什么? - Zookeeper - what will happen if I pass in a connection string only some of the nodes from the zk cluster (ensemble)? 如何使用外部Zookeeper使用3台机器(1个Manager和2个节点)设置NiFi群集 - How to setup NiFi cluster using 3 machines (1 Manager & 2 nodes) using external zookeeper 在多个ec2节点上设置Zookeeper集群时0.0.0.0是什么意思 - What's the meaning of 0.0.0.0 when setting up zookeeper cluster on multiple ec2 nodes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM