Master left reason – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.17

Briefly, this error occurs when the master node in an Elasticsearch cluster becomes unavailable or leaves the cluster due to network issues, hardware failure, or high load. To resolve this issue, you can: 1) Check the network connectivity between the nodes; 2) Monitor the load on the master node and scale up resources if necessary; 3) Ensure the master node’s hardware is functioning properly; 4) Check the Elasticsearch logs for more detailed error messages; 5) If the master node is permanently lost, promote another node to be the master.

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

Log Context

Log “master_left [{}]; reason [{}]” classname is ZenDiscovery.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

        if (localNodeMaster()) {
            // we might get this on both a master telling us shutting down; and then the disconnect failure
            return;
        }

        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));

 

 [ratemypost]