我使用以下代码创建elasticsearch的客户端节点。直到现在突然我才开始获得MasterNotDiscoveredException,这一点工作正常。我已将配置值更改为,但问题仍然相同。
discovery.zen.ping.multicast.enabled:false
如果我切换到TransportClient,则同样有效。请告诉我节点客户端的问题
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)