When creating a node client receiving org.elasticsearch.discovery.MasterNotDiscoveredException

I am using the below code to create a node elasticsearch client. The same has been in effect until now when all of a sudden I started getting MasterNotDiscoveredException. I changed the config value like but still the problem is the same.

discovery.zen.ping.multicast.enabled: false

If I switch to TransportClient then it works. Please let me know what is the problem with the node client

public static Client createESClient() {
    // creating a client node
    Node node =
        nodeBuilder().clusterName(CLUSTERNAME).client(true).data(false)
            .node();
    Client client = node.client();
    LOGGER.debug("the node has been created ");
    return client;
}

      


Exception in thread "main" org.elasticsearch.discovery.MasterNotDiscoveredException: waited for [30s]
    at org.elasticsearch.action.support.master.TransportMasterNodeOperationAction$3.onTimeout(TransportMasterNodeOperationAction.java:180)
    at org.elasticsearch.cluster.service.InternalClusterService$NotifyTimeout.run(InternalClusterService.java:491)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

      

+3


source to share





All Articles