good day eveyone , why do we need 3 nodes in elasticsearch cluster for guarantee the high availibility and disaster recovery

Master election is based on majority decisions and only when you have 3 nodes or more can you form a strict majority without ALL nodes present. This allows a master to be elected even if one of the nodes is down.

1 Like

so if one of nodes is down the other node can elect another master right?

Yes, the other 2 nodes can form a majority and elect the master.

So, for example, if we have two nodes and one of them is disabled, could the remaining node elect itself?

No. The strict majority of 2 is 2, so both nodes are needed to elect a master. That is why 3 is the minimum.

1 Like

so if the master is down the 2 nodes will elect one of them as master

If any node goes down the remaining nodes will verify they can form a majority and elect a master if necessary.

thank you very much