Reputation: 1
I have a two node redhat system with an identical set of services on each. I am looking for a way to determine which service is "in charge" and which is a "running backup". So for example; service-A exists and is running on both nodes but only one should be processing data while the other sleeps until the first crashes. Same for other services in the set.
Zookeeper's leader election capability looked like it would suffice; the whole ephemeral and sequential znode approach looked good on paper. I imagined that I would also need a zookeeper service running on each node for redundancy in the face of node failure, for example.
But the documentation points out issues with multiple zookeeper's requiring at least 3 instances in order to guarantee a quorum to elect the lead zookeeper among all other zookeepers. As I only have two nodes this looks like a deal-breaker.
So before I drop the zookeeper approach, I thought I ask if there were some configuration option to zookeeper to allow a two node system to work. Otherwise I'm off to find the next best fit for my problem.
Upvotes: 0
Views: 1366
Reputation: 401
You can run Zookeeper with just two instances. However, it gives you no benefit of fault tolerance because the quorum is till 2 in that case. Any one of them failing will result in Zookeeper ensemble rejecting client requests. That's why the default configuration for an ensemble is 3 Zookeeper instances because having 2 instances is no better than having 1 so why go through the trouble of creating 2? It actually creates more points of failures because when either instance dies, your Zookeeper ensemble halts and having either one of two to fail is more likely to have just one to fail.
Upvotes: 2