Local node is not master – How to solve this Elasticsearch exception

Opster Team

August-23, Version: 6.8-7.17

Briefly, this error occurs when the Elasticsearch node you’re trying to perform an operation on is not the master node. In a cluster, only the master node can perform certain operations like creating or deleting indices. To resolve this, you can either perform the operation on the master node or configure your client to automatically redirect requests to the master node. Additionally, ensure that your cluster health is good and all nodes are properly connected. If the master node is down, a new master should be elected by the cluster.

This guide will help you check for common problems that cause the log ” local node is not master ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: master, node, discovery.

Log Context

Log “local node is not master” class name is MasterFaultDetection.java. We extracted the following from Elasticsearch source code for those seeking an in-depth context :

 return currentState;
 }  @Override
 public void onNoLongerMaster(String source) {
 onFailure(source; new NotMasterException("local node is not master"));
 }  @Override
 public void onFailure(String source; @Nullable Exception e) {
 if (e == null) {

 

 [ratemypost]