Received cluster state from which is also master but with a different cluster name – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.15

Briefly, this error occurs when there is a mismatch in the cluster names between the master node and the other nodes in the Elasticsearch cluster. This could be due to incorrect configuration or a network partition. To resolve this issue, you can check and correct the cluster name in the Elasticsearch configuration file on all nodes. Also, ensure that all nodes are using the same version of Elasticsearch. If the problem persists, consider restarting the Elasticsearch service on all nodes.

This guide will help you check for common problems that cause the log ” received cluster state from [{}] which is also master but with a different cluster name [{}] ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: cluster, discovery, master.

Log Context

Log “received cluster state from [{}] which is also master but with a different cluster name [{}]” classname is ZenDiscovery.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

     * does simple sanity check of the incoming cluster state. Throws an exception on rejections.
     */
    static void validateIncomingState(Logger logger; ClusterState incomingState; ClusterState lastState) {
        final ClusterName incomingClusterName = incomingState.getClusterName();
        if (incomingClusterName.equals(lastState.getClusterName()) == false) {
            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";

 

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?