Unexpected error while joining cluster trying again – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 6.8-7.17

Briefly, this error occurs when a node in Elasticsearch fails to join a cluster due to network issues, incorrect configuration, or version incompatibility. To resolve this, ensure all nodes have the correct cluster name and network settings. Check for firewall rules that may be blocking communication. Also, ensure all nodes are running compatible Elasticsearch versions. If the problem persists, consider increasing the ‘discovery.zen.ping_timeout’ value to allow more time for the node to join the cluster.

This guide will help you check for common problems that cause the log ” unexpected error while joining cluster; trying again ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: discovery.

Log Context

Log “unexpected error while joining cluster; trying again” classname is ZenDiscovery.java.
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

                    while (running.get() && joinThreadActive(currentThread)) {
                        try {
                            innerJoinCluster();
                            return;
                        } catch (Exception e) {
                            logger.error("unexpected error while joining cluster; trying again"; e);
                            // Because we catch any exception here; we want to know in
                            // tests if an uncaught exception got to this point and the test infra uncaught exception
                            // leak detection can catch this. In practise no uncaught exception should leak
                            assert ExceptionsHelper.reThrowIfNotNull(e);
                        }

 

 [ratemypost]