Received a cluster state from and not part of the cluster should not happen – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.15

Briefly, this error occurs when a node receives a cluster state from a master node that it doesn’t recognize as part of its own cluster. This could be due to network issues, incorrect configuration, or a split-brain scenario. To resolve this, ensure that all nodes have the correct cluster name and are able to communicate with each other. Check the network settings and firewall rules. Also, consider enabling the discovery.zen.minimum_master_nodes setting to prevent split-brain situations.

This guide will help you check for common problems that cause the log ” received a cluster state from [{}] and not part of the cluster; should not happen ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: cluster, discovery.

Log Context

Log “received a cluster state from [{}] and not part of the cluster; should not happen” classname is ZenDiscovery.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

            logger.warn("received cluster state from [{}] which is also master but with a different cluster name [{}]";
                incomingState.nodes().getMasterNode(); incomingClusterName);
            throw new IllegalStateException("received state from a node that is not part of the cluster");
        }
        if (lastState.nodes().getLocalNode().equals(incomingState.nodes().getLocalNode()) == false) {
            logger.warn("received a cluster state from [{}] and not part of the cluster; should not happen";
                incomingState.nodes().getMasterNode());
            throw new IllegalStateException("received state with a local node that does not match the current local node");
        }

        if (shouldIgnoreOrRejectNewClusterState(logger; lastState; incomingState)) {

 

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?