# Elastic search 2.3.2 Java Transport Client NoNodeAvailableException

**URL:** <https://discuss.elastic.co/t/elastic-search-2-3-2-java-transport-client-nonodeavailableexception/49183>\
**Category:** Elasticsearch\
**Created:** [May 4, 2016, 1:58pm UTC](https://discuss.elastic.co/t/elastic-search-2-3-2-java-transport-client-nonodeavailableexception/49183 "2016-05-04T13:58:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mephicide](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@mephicide](https://discuss.elastic.co/u/mephicide)\
**Post date:** [May 4, 2016, 1:58pm UTC](https://discuss.elastic.co/t/elastic-search-2-3-2-java-transport-client-nonodeavailableexception/49183/1 "2016-05-04T13:58:46Z")

</div>

I looked through this discussion group for a long time to see if anyone had posted a similar issue, and fond a few, but both the problems and the solutions for those issues differed from what I am experiencing. I posted on SO here [http://stackoverflow.com/questions/37016135/elasticsearch-java-transport-client-nonodeavailableexception-on-ubuntu-14-04](http://stackoverflow.com/questions/37016135/elasticsearch-java-transport-client-nonodeavailableexception-on-ubuntu-14-04).

I am running **Elasticsearch v. 2.3.2** , using Java 7. Following is the printout from `curl http://172.31.11.83:9200`:

```
{
  "name" : "ip-172-31-11-83",
  "cluster_name" : "elasticsearch",
  "version" : {
      "number" : "2.3.2",
      "build_hash" : "b9e4a6acad4008027e4038f6abed7f7dba346f94",
      "build_timestamp" : "2016-04-21T16:03:47Z",
      "build_snapshot" : false,
      "lucene_version" : "5.5.0"
    },
  "tagline" : "You Know, for Search"
}

```

... and I am using the following in my Java code:

```
<dependency>
    <groupId>org.elasticsearch</groupId>
    <artifactId>elasticsearch</artifactId>
    <version>2.3.2</version>
</dependency>

```

**I have ports 9200 and 9300 open in my firewall rules** for my ES server, and can successfully execute said Java code from my laptop (Mac OSX). Following is the code snippet that starts off the process (this works fine):

```
Settings settings = Settings.settingsBuilder()
		        .put("cluster.name", "elasticsearch").build();
		esClient =TransportClient.builder().settings(settings).build().addTransportAddress(new 
				InetSocketTransportAddress(new InetSocketAddress(InetAddress.getByName("172.31.11.83"), 9300)));

```

Then later, I try to issue an index request (this fails when I run the code on **Ubuntu 14.04** :

```
adminClient = esClient.admin().indices();
IndicesExistsResponse response = adminClient.exists(request).actionGet();

```

My **elasticsearch.yml** file contains the following network settings:

```
network.bind_host: 0
network.publish_host: 172.31.11.83
transport.tcp.port: 9300
http.port: 9200

```

I have also tried with `network.bind_host: 172.31.11.83` to no avail. Using `curl`, I can get to port 9200 from all machines. **The cluster name reported by curl is "elasticsearch"**.

When I start ES, I see the following in the **elasticsearch.log** :

```
publish_address {172.31.11.83:9300}, bound_addresses {[::]:9300}

```

And yet, the exception I get is as follows:

```
NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{172.31.11.83}{172.31.11.83:9300}]]
at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:290)
at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:207)
at org.elasticsearch.client.transport.support.TransportProxyClient.execute(TransportProxyClient.java:55)
at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:283)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:347)
at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:336)
at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.execute(AbstractClient.java:1178)
at org.elasticsearch.client.support.AbstractClient$IndicesAdmin.exists(AbstractClient.java:1198)

```

Again, this exact code works from my local machine. Any thoughts?

---

<div class="post-metadata">

**Author:** ![sohilelasticsearch](https://avatars.discourse-cdn.com/v4/letter/s/ecc23a/32.png) [@sohilelasticsearch](https://discuss.elastic.co/u/sohilelasticsearch)\
**Post date:** [June 15, 2016, 4:47am UTC](https://discuss.elastic.co/t/elastic-search-2-3-2-java-transport-client-nonodeavailableexception/49183/2 "2016-06-15T04:47:58Z")

</div>

I am also getting the same error.  
Please someone help on this error.

---

<div class="post-metadata">

**Author:** ![iliasse](https://avatars.discourse-cdn.com/v4/letter/i/22d042/32.png) [@iliasse](https://discuss.elastic.co/u/iliasse)\
**Post date:** [June 17, 2016, 9:32am UTC](https://discuss.elastic.co/t/elastic-search-2-3-2-java-transport-client-nonodeavailableexception/49183/3 "2016-06-17T09:32:05Z")

</div>

Try with  
network.host: 0.0.0.0

comment both network.bind\_host: 0 and network.publish\_host: 172.31.11.83

---

<div class="post-metadata">

**Author:** ![danbornman](https://avatars.discourse-cdn.com/v4/letter/d/bbce88/32.png) [@danbornman](https://discuss.elastic.co/u/danbornman)\
**Post date:** [November 15, 2016, 7:14pm UTC](https://discuss.elastic.co/t/elastic-search-2-3-2-java-transport-client-nonodeavailableexception/49183/4 "2016-11-15T19:14:16Z")

</div>

I am also getting the same error. I've done all the same checks as mephicide above and I'm getting the same error. I am running version 2.3.1 on both the VM where ElasticSearch is installed and in the java elasticsearch core library.

---

<div class="post-metadata">

**Author:** ![Anantha](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Anantha](https://discuss.elastic.co/u/Anantha)\
**Post date:** [November 16, 2016, 9:05am UTC](https://discuss.elastic.co/t/elastic-search-2-3-2-java-transport-client-nonodeavailableexception/49183/5 "2016-11-16T09:05:51Z")

</div>

@danbornman

1. In elasticsearch.yml add the below properties

[cluster.name](http://cluster.name): production  
[node.name](http://node.name): node1  
network.bind\_host: 10.0.1.22  
network.host: 0.0.0.0  
transport.tcp.port: 9300

1. Add the following in Java Elastic API for Bulk Push (just a snippet code)

## For IP Address add public ip address of elastic search machine

Client client;  
BulkRequestBuilder requestBuilder;  
try {  
client = TransportClient.builder().settings(Settings.builder().put("[cluster.name](http://cluster.name)", "production").put("[node.name](http://node.name)","node1")).build().addTransportAddress(  
new InetSocketTransportAddress(InetAddress.getByName(""), 9300));  
requestBuilder = (client).prepareBulk();  
} catch (Exception e) {  
}

* * *

1. 

Open the Firewall ports for 9200,9300

Thanks  
Anantha

---

<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:** [July 5, 2017, 10:05pm UTC](https://discuss.elastic.co/t/elastic-search-2-3-2-java-transport-client-nonodeavailableexception/49183/6 "2017-07-05T22:05:43Z")

</div>


