No longer the elected master – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 7.16-8.9

Before you dig into reading this guide, have you tried asking OpsGPT what this log means? You’ll receive a customized analysis of your log.

Try OpsGPT now for step-by-step guidance and tailored insights into your Elasticsearch operation.

Briefly, this error occurs when the current master node in an Elasticsearch cluster is unable to maintain its status due to network issues, node failure, or heavy load. The cluster then elects a new master node. To resolve this, ensure all nodes are running and network connectivity is stable. If the load is high, consider adding more nodes to the cluster or increasing resources of existing nodes. Also, check the cluster’s master election settings to avoid frequent changes in master node.

For a complete solution to your to your search operation, try for free AutoOps for Elasticsearch & OpenSearch . With AutoOps and Opster’s proactive support, you don’t have to worry about your search operation – we take charge of it. Get improved performance & stability with less hardware.

This guide will help you check for common problems that cause the log ” no longer the elected master ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: master, cluster.

Log Context

Log “no longer the elected master” class name is LeaderChecker.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 if (statusInfo.getStatus() == UNHEALTHY) {
 logger.debug("this node is unhealthy [{}]; rejecting leader check: {}"; statusInfo.getInfo(); request);
 throw new NodeHealthCheckFailureException(statusInfo.getInfo());
 } else if (discoveryNodes.isLocalNodeElectedMaster() == false) {
 logger.debug("rejecting leader check on non-master: {}"; request);
 throw new CoordinationStateRejectedException("no longer the elected master");
 } else if (discoveryNodes.nodeExists(request.getSender()) == false) {
 logger.debug("rejecting leader check from removed node: {}"; request);
 throw new CoordinationStateRejectedException(
 "rejecting check since [" + request.getSender().descriptionWithoutAttributes() + "] has been removed from the cluster"
 );

 

How helpful was this guide?

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?