Master left – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.17

Briefly, this error occurs when the master node in an Elasticsearch cluster becomes unavailable or disconnects. This could be due to network issues, resource constraints, or the master node crashing. To resolve this issue, you can ensure the master node is running and reachable, check for network connectivity issues, or increase resources if they are insufficient. Additionally, consider configuring your cluster with multiple master-eligible nodes to prevent a single point of failure.

This guide will help you check for common problems that cause the log ” master left [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: master, discovery.

Log Context

Log “master left [{}]” class name is ZenDiscovery.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
logger.info(() -> new ParameterizedMessage("master_left [{}]; reason [{}]"; masterNode; reason); cause); synchronized (stateMutex) {
if (localNodeMaster() == false && masterNode.equals(committedState.get().nodes().getMasterNode())) {
// flush any pending cluster states from old master; so it will not be set as master again
pendingStatesQueue.failAllStatesAndClear(new ElasticsearchException("master left [{}]"; reason));
rejoin("master left (reason = " + reason + ")");
}
}
}<p></p>
logger.info(() -> new ParameterizedMessage("master_left [{}]; reason [{}]"; masterNode; reason); cause); synchronized (stateMutex) { if (localNodeMaster() == false && masterNode.equals(committedState.get().nodes().getMasterNode())) { // flush any pending cluster states from old master; so it will not be set as master again pendingStatesQueue.failAllStatesAndClear(new ElasticsearchException("master left [{}]"; reason)); rejoin("master left (reason = " + reason + ")"); } } }<p></p>
 logger.info(() -> new ParameterizedMessage("master_left [{}]; reason [{}]"; masterNode; reason); cause);  synchronized (stateMutex) {
 if (localNodeMaster() == false && masterNode.equals(committedState.get().nodes().getMasterNode())) {
 // flush any pending cluster states from old master; so it will not be set as master again
 pendingStatesQueue.failAllStatesAndClear(new ElasticsearchException("master left [{}]"; reason));
 rejoin("master left (reason = " + reason + ")");
 }
 }
 }

 

 [ratemypost]

Opster
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.