Ashish Vyas
Ashish Vyas

Reputation: 617

hazelcast cluster with even number of members

I am using Hazelcast 3.12.5 I want to know if we can run hazelcast cluster on even number of nodes or odd number is required/ preferred. Is there any split brain issue or something similar that is bound to happen/ chances of split brain increase if I run odd number of nodes.

This is probably basic, but I wanted to be sure - wanted to know some real world experiences from the community. I do not like to incur cost to go up from three to five nodes when four nodes should be sufficient to do the job, but as the same time not run with four nodes if we will have any drawbacks with even sized cluster.

Upvotes: 0

Views: 719

Answers (2)

jesantana
jesantana

Reputation: 1293

Hazelcast is by default AP regarding CAP theorem. Given this, in case of split brain, no leader election is occurring and you will only receive info from the partition you are accessing. This is not true if your system use new CP subsystem which was introduced in 3.12 which uses Raft algorithm to elect the leader node and ensure consistency.

Resuming I think that if you use CP subsystem it is recommended to have odd number of nodes, if you don't the number that you use is irrelevant.

Upvotes: 0

Nicolas
Nicolas

Reputation: 1186

In software that have clusters with leader elections, you should always strive to have an odd number of nodes (and not 1) to have an undisputed leader election.

Hence, the minimum number of nodes should be 3.

Upvotes: 1

Related Questions