Elasticsearch cluster

Hi, a little confused reading the documentation on creating a cluster https://www.elastic.co/guide/en/elasticsearch/reference/7.17/high-availability-cluster-small-clusters.html#high-availability-cluster-design-two-nodes

  1. Regarding "two-nodes clusters", the documentation says
If you have two nodes, we recommend they both be data nodes

Recommendation to use 2 date nodes, next paragraph:

We recommend you set node.master: false on one of your two nodes so that it is not master-eligible. This means you can be certain which of your nodes is the elected master of the cluster. The cluster can tolerate the loss of the other master-ineligible node. If you don’t set node.master: false on one node, both nodes are master-eligible. This means both nodes are required for a master election. Since the election will fail if either node is unavailable, your cluster cannot reliably tolerate the loss of either node.

There are 2 nodes (node1 and node2), one should preferably be a master, for example, there is (as stated in the documentation, if roles are explicitly specified, then only they will be assigned) node1 - roles (master - true, date - true), node2 - roles (master - false, date - true), questions:

  1. If node1 fails, does the cluster stop or node2 becomes the master?
  2. Node2 fails, node1 takes over all traffic?
    Next paragraph
We recommend you assign both nodes all other roles except master eligibility.

I didn’t understand a bit, in the case of a two-nodes cluster, should I use 2 date nodes, 1 master node and one non-master node, or put everything except the master?

And one more thing, regarding "Two-node clusters with a tiebreaker", adding to the two masters one more "dedicated voting-only master-eligible node" in case of failure of the first master, the second will take its place, and the third ("tiebreaker" ) will just be used for voting, but he will never become a master himself?

A 2 node cluster is resilient with respect to data loss, i.e. if you lose either node you will still have a couple of your data assuming all indices have a replica.

Node 1: Master Eligible + Data
Node 2 ; Data

If you lose Node 1 the cluster will not operate until you fix it but you will still have a copy of the data
If you lose Node 2 the cluster will continue to operate in a degraded / yellow fashion

If you do the 2 Nodes + Voting Only
Node 1: Master Eligible + Data
Node 2: Master Eligible + Data
Node 3: Master Voting Only

You can lose any of the 3 nodes and the cluster will continue to operate but if you lose 3 only you are risk of having an issue if another node fails as described in the 2 node (master election will fail)... and no the voting only master node will never become and actual master node.

A voting-only master-eligible node is a node that participates in master elections but which will not act as the cluster’s elected master node.

All this said... many of use would just recommend a 3 node cluster with All 3 Master Eligible + Data, that is the best bang for your buck resiliency if that is what you are after.

1 Like

Thanks for the clarification, the last question, about the situation with 3 nodes, where is the 3rd (Master Voting Only), if the 3rd and 2nd nodes fall, then the masters will not be able to choose, cluster operation is not possible with one master?

Hi @alex_96

With respect to the question above... It will depend on the order and timing of the failures. If you are planning to survive 2 nodes out of 3 to fail in quick secession ... then perhaps you should be considering a more resilient cluster architecture with separate master and data nodes etc.

I will go back to my original suggestion 3 Nodes Each Data + Master Eligible.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.