# No Nodes Available Exception

**URL:** <https://discuss.elastic.co/t/no-nodes-available-exception/114388>\
**Category:** Elasticsearch\
**Created:** [January 6, 2018, 4:56pm UTC](https://discuss.elastic.co/t/no-nodes-available-exception/114388 "2018-01-06T16:56:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepak\_Goel](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@Deepak\_Goel](https://discuss.elastic.co/u/Deepak_Goel)\
**Post date:** [January 6, 2018, 4:56pm UTC](https://discuss.elastic.co/t/no-nodes-available-exception/114388/1 "2018-01-06T16:56:31Z")

</div>

**Hello**

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

1. 

[cluster.name](http://cluster.name): production  
[node.name](http://node.name): elasticsearch-node  
node.master: true  
node.data : true  
2.  
[cluster.name](http://cluster.name): production  
[node.name](http://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**

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 6, 2018, 5:32pm UTC](https://discuss.elastic.co/t/no-nodes-available-exception/114388/2 "2018-01-06T17:32:37Z")

</div>

You did not define the node to connect to.

BTW [node.name](http://node.name) is useless in the context of the transport client.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 3, 2018, 5:32pm UTC](https://discuss.elastic.co/t/no-nodes-available-exception/114388/3 "2018-02-03T17:32:44Z")

</div>

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