FAQ

On Sat, Dec 12, 2015 at 8:07 PM, Flavio Junqueira wrote:

Hi Kaushal,

On 12 Dec 2015, at 04:07, Kaushal Shriyan wrote:

Hi,

I have couple of questions which are as below :-

1) In a 3 node single ensemble, i have 1 leader and 2 followers. when i
triggers in between the remaining 2 nodes and i see that one of the node
becomes a leader and the other is a follower. I am not sure if i
completely
understood it. Since there are only 2 nodes how does leader election happen
because we need odd numbers in order to form a quorum. Please correct me if
i am understanding it wrong.
You need an odd number of total members in the ensemble. If you have an
ensemble of 3, then you can tolerate one crashed server, which means that
your quorums have size two. That's why two servers can elect a leader among
them.

In general, if n is the number of servers in the ensemble, then you can
tolerate f crashed servers and the relationship between n and f is n = 2f +
1.
2) Is it possible to configure 3 nodes each in DC1 and DC2?
meaning 1 ensemble consists of 6 nodes with 3 nodes in DC-1 and 3 nodes in
DC-2
DC-2 1 Follower 2 Observers.

if DC-1 goes down, will there be a leader election between 3 nodes in DC-2?
No, the two observers won't participate in the election, and the remaining
participant in DC-2 will keep waiting for DC-1 to come back up.

This question about tolerating a DC going down using a second DC is a
classic one. If we allowed DC-2 to elect a leader in the total absence of
processes of DC-1, then we would be prone to split brain scenarios: DC-1
suspects DC-2 and vice-versa, but they are both up. If you want
availability when a DC going down, you need a third DC. Also, keep in mind
that availability here refers to both reads and writes. You can set it up

-Flavio
Thanks Flavio for a detailed explanation. Based on the explanation.

If i lets say if i set the below config

DC-1 1 Leader and 2 Followers
DC-2 2 Followers and 1 observer

Is this a good solution meaning 1 ensemble having 6 nodes. In my earlier
setup it was *1 Follower and 2 Observers in DC-2*. Now i changed it in DC-2
2 Followers and 1 observer. In this case there are 2 Followers which will

Regarding "If you want availability when a DC going down, you need a third
DC. Also, keep in mind that availability here refers to both reads and
writes. You can set it up to go into read-only mode"

you say set up the below configs for high availability.

DC-1 1 Leader and 2 Followers
DC-2 2 Followers and 1 observer
DC-3 2 Followers and 1 observer.

Regards,

Kaushal

## Related Discussions

 view thread | post posts ‹ prev | 3 of 12 | next ›
Discussion Overview
 group user categories zookeeper, hadoop posted Dec 12, '15 at 4:07a active Mar 9, '16 at 3:04p posts 12 users 6 website zookeeper.apache.org irc #zookeeper

### 6 users in discussion

Content

People

Support

Translate

site design / logo © 2022 Grokbase