Multicast socket closed while running restarting – How to solve this Elasticsearch error

Opster Team

Aug-23, Version: 2.3-2.3

Briefly, this error occurs when Elasticsearch is unable to communicate with other nodes in the cluster due to the multicast socket being closed. This could be due to network issues, firewall settings, or incorrect configuration. To resolve this issue, you can try the following: 1) Check your network connection and ensure that all nodes are reachable. 2) Review your firewall settings to ensure that they are not blocking the necessary ports. 3) Verify your Elasticsearch configuration, particularly the settings related to multicast discovery. 4) Consider switching to unicast discovery if multicast continues to be problematic.

This guide will help you check for common problems that cause the log ” multicast socket closed while running; restarting… ” to appear. To understand the issues related to this log, read the explanation below about the following Elasticsearch concepts: discovery, discovery-multicast and Plugin.

Log Context

Log “multicast socket closed while running; restarting…” classname is
We extracted the following from Elasticsearch source code for those seeking an in-depth context :

} catch (SocketTimeoutException ignore) {
                            } catch (Exception e) {
                                if (running) {
                                    if (multicastSocket.isClosed()) {
                                        logger.warn("multicast socket closed while running; restarting...");
                                        multicastSocket = buildMulticastSocket(config);
                                    } else {
                                        logger.warn("failed to receive packet; throttling..."; e);