Clustered elasticsearch setup (two master nodes)


We are currently setting up an environment with two elasticsearch instances (clustered servers).

Since it's clustered, we need to make sure that data (indexes) are synched between the two instances.

We do not have the possibility to setup an additional (3rd) server/instance to act as the 'master'.

Therefore we have configured both instances as master and data nodes. So instance 1 is master & node and instance 2 is also master & node.

The synchronization works fine when both instances are up and running. But when one instance is down, the other instance keeps trying to connect with the instance that is down, which obviously fails because the instance is down. Therefore the node that is up is also not functioning anymore, because it can not connect to his 'master' node (which is the node that is down), even though the instance itself is also a 'master'.

The following errors are logged in this case:

  • org.elasticsearch.cluster.block.ClusterBlockException: blocked by: [SERVICE_UNAVAILABLE/2/no master];
  • org.elasticsearch.transport.ConnectTransportException: [xxxxx-xxxxx-2][xx.xx.xx.xx:9300] connect_exception
  • Caused by:$AnnotatedConnectException: Connection refused: no further information: xx.xx.xx.xx/xx.xx.xx.xx:9300

In short: two elasticsearch master instances in a clustered setup. When one is down, the other one does not function because it can not connect to the 'master' instance.

Desired result: If one of the master instances is down, the other should continue functioning (without throwing errors).

Any recommendations on how to solve this, without having to setup an additional server that is the 'master' and the other 2 the 'slaves'?


This is not possible as a minimum of 3 master eligible nodes are required in order to achieve a fault tolerant cluster that can continue operating even when one node is down.

It is not possible. You need 3 nodes that are all master-eligible - Elasticsearch is a clustered system, not master-slave.

1 Like

The only way to do this is to have two separate clusters and then use cross cluster replication.

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