No Nodes Available Exception


(Deepak Goel) #1

Hello

I created two nodes (elasticsearch-node, client-node) on the same machine. Started them. Configuration is as follows:

cluster.name: production
node.name: elasticsearch-node
node.master: true
node.data : true
2.
cluster.name: production
node.name: client-node
node.master: false
node.data : true

Both the nodes started.

Java code:

	Settings settings = Settings.builder()
	        .put("cluster.name", "production")
	        .put("node.name","elasticsearch-node")
	        .build();
	TransportClient client = new PreBuiltTransportClient(settings);

When I try to connect through Java, I am getting the following exception:

NoNodeAvailableException[None of the configured nodes are available: []]
org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:347)
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:245)
org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:60)
org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:360)
org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:405)
org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:394)
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:46)
ElasticsearchExample.doGet(ElasticsearchExample.java:63)
javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Any insights?

Thank You
Deepak


(David Pilato) #2

You did not define the node to connect to.

BTW node.name is useless in the context of the transport client.


(system) #3

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.