# Elasticsearch Transportclient throws a NoNodeAvailableException in an integration test

**URL:** <https://discuss.elastic.co/t/elasticsearch-transportclient-throws-a-nonodeavailableexception-in-an-integration-test/16740>\
**Category:** Elasticsearch\
**Created:** [April 1, 2014, 3:04pm UTC](https://discuss.elastic.co/t/elasticsearch-transportclient-throws-a-nonodeavailableexception-in-an-integration-test/16740 "2014-04-01T15:04:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dario\_Rossi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dario_rossi/32/1672_2.png) [@Dario\_Rossi](https://discuss.elastic.co/u/Dario_Rossi)\
**Post date:** [April 1, 2014, 3:04pm UTC](https://discuss.elastic.co/t/elasticsearch-transportclient-throws-a-nonodeavailableexception-in-an-integration-test/16740/1 "2014-04-01T15:04:43Z")

</div>

So I've a test where I try to connect to a local embedded Elasticsearch  
node that usually works with other tests. The embedded node is also local =  
true. It works in two other tests, one uses the HTTP Rest API and the other  
the data less node client. They both work good.

But when I try to use the TransportClient like this:

Settings settings = ImmutableSettings.settingsBuilder()  
.put("client.transport.ignore\_cluster\_name", false)  
.put("cluster.name", clusterName)  
.put("client.transport.sniff", false)  
.put("client.transport.ping\_timeout", pingTimeout)  
.put("client.transport.nodes\_sampler\_interval",pingSamplerInterval  
).build();

```
    client = new TransportClient(settings);

    String hostPieces[] = hosts.split(",");
    for (String piece : hostPieces){
        String hostAndPort[] = piece.trim().split(":");
        if (hostAndPort.length != 2){
            throw new IllegalArgumentException("Error in hosts string: "

```

- piece);  
}  
String host = hostAndPort[0].trim();  
String portStr = hostAndPort[1].trim();

InetSocketTransportAddress(host, Integer.valueOf(portStr));

```
        client.addTransportAddress(address);
    }

```

although at the begging it seems to connect to the local node, then it dies:

[2014-04-01 15:31:21,504][DEBUG][org.elasticsearch.client.transport] [Googam  
] adding address [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
[2014-04-01 15:31:21,517][DEBUG][org.elasticsearch.transport.netty] [Googam]connected to node  
[[#transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
[2014-04-01 15:31:31,316][DEBUG][org.elasticsearch.cluster.service] [  
Sepulchre] processing [routing-table-updater]: execute  
[2014-04-01 15:31:31,317][DEBUG][org.elasticsearch.cluster.service] [  
Sepulchre] processing [routing-table-updater]: no change in cluster\_state  
[2014-04-01 15:32:16,521][INFO][org.elasticsearch.client.transport] [Googam  
] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],  
disconnecting...  
org.elasticsearch.transport.ReceiveTimeoutTransportException: [][inet[  
localhost/127.0.0.1:11547]][cluster/nodes/info] request\_id [0] timed outafter  
[55001ms]  
at org.elasticsearch.transport.TransportService$TimeoutHandler.run(  
TransportService.java:356)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.  
java:1145)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor  
.java:615)  
at java.lang.Thread.run(Thread.java:724)  
[2014-04-01 15:32:16,525][DEBUG][org.elasticsearch.transport.netty] [Googam]disconnected  
from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
[2014-04-01 15:32:16,527][DEBUG][org.elasticsearch.transport.netty] [Googam]connected to node  
[[#transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
[2014-04-01 15:32:16,530][INFO][org.elasticsearch.node] [Sepulchre]stopping  
...  
[2014-04-01 15:32:16,530][DEBUG][org.elasticsearch.transport.netty] [Googam]disconnected  
from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]], channel closed  
event  
[2014-04-01 15:32:16,532][INFO][org.elasticsearch.client.transport] [Googam  
] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],  
disconnecting...  
org.elasticsearch.transport.NodeDisconnectedException: [][inet[localhost/  
127.0.0.1:11547]][cluster/nodes/info] disconnected  
[2014-04-01 15:32:16,534][INFO][org.elasticsearch.node] [Sepulchre]stopped  
Exception in thread "Thread-1" org.elasticsearch.client.transport.  
NoNodeAvailableException: No node available

In the log you have Googam that is the TransportClient and Sepulchre that  
is the embedded node.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1a8729d1-aa82-4dc8-857c-52c633ac540a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1a8729d1-aa82-4dc8-857c-52c633ac540a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![IronMike](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@IronMike](https://discuss.elastic.co/u/IronMike)\
**Post date:** [April 1, 2014, 3:15pm UTC](https://discuss.elastic.co/t/elasticsearch-transportclient-throws-a-nonodeavailableexception-in-an-integration-test/16740/2 "2014-04-01T15:15:57Z")

</div>

Is the transportclient working on port 9300 to begin with?

On Tuesday, April 1, 2014 11:04:43 AM UTC-4, Dario Rossi wrote:

> So I've a test where I try to connect to a local embedded Elasticsearch  
> node that usually works with other tests. The embedded node is also local =  
> true. It works in two other tests, one uses the HTTP Rest API and the other  
> the data less node client. They both work good.
> 
> But when I try to use the TransportClient like this:
> 
> Settings settings = ImmutableSettings.settingsBuilder()  
> .put("client.transport.ignore\_cluster\_name", false)  
> .put("cluster.name", clusterName)  
> .put("client.transport.sniff", false)  
> .put("client.transport.ping\_timeout", pingTimeout)  
> .put("client.transport.nodes\_sampler\_interval",pingSamplerInterval  
> ).build();
> 
> ```
> client = new TransportClient(settings);
> 
> String hostPieces[] = hosts.split(",");
> for (String piece : hostPieces){
> String hostAndPort[] = piece.trim().split(":");
> if (hostAndPort.length != 2){
> throw new IllegalArgumentException("Error in hosts 
> 
> ```
> 
> string: "+ piece);  
> }  
> String host = hostAndPort[0].trim();  
> String portStr = hostAndPort[1].trim();
> 
> ```
> InetSocketTransportAddress address = new 
> 
> ```
> 
> InetSocketTransportAddress(host, Integer.valueOf(portStr));
> 
> ```
> client.addTransportAddress(address);
> }
> 
> ```
> 
> although at the begging it seems to connect to the local node, then it  
> dies:
> 
> [2014-04-01 15:31:21,504][DEBUG][org.elasticsearch.client.transport] [  
> Googam] adding address [[  
> #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> [2014-04-01 15:31:21,517][DEBUG][org.elasticsearch.transport.netty] [  
> Googam] connected to node [[  
> #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> [2014-04-01 15:31:31,316][DEBUG][org.elasticsearch.cluster.service] [  
> Sepulchre] processing [routing-table-updater]: execute  
> [2014-04-01 15:31:31,317][DEBUG][org.elasticsearch.cluster.service] [  
> Sepulchre] processing [routing-table-updater]: no change in cluster\_state  
> [2014-04-01 15:32:16,521][INFO][org.elasticsearch.client.transport] [  
> Googam] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],  
> disconnecting...  
> org.elasticsearch.transport.ReceiveTimeoutTransportException: [inet[  
> localhost/127.0.0.1:11547]][cluster/nodes/info] request\_id [0] timed outafter  
> [55001ms]  
> at org.elasticsearch.transport.TransportService$TimeoutHandler.run(  
> TransportService.java:356)  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(  
> ThreadPoolExecutor.java:1145)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(  
> ThreadPoolExecutor.java:615)  
> at java.lang.Thread.run(Thread.java:724)  
> [2014-04-01 15:32:16,525][DEBUG][org.elasticsearch.transport.netty] [  
> Googam] disconnected from [[  
> #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> [2014-04-01 15:32:16,527][DEBUG][org.elasticsearch.transport.netty] [  
> Googam] connected to node [[  
> #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> [2014-04-01 15:32:16,530][INFO][org.elasticsearch.node] [Sepulchre]stopping  
> ...  
> [2014-04-01 15:32:16,530][DEBUG][org.elasticsearch.transport.netty] [  
> Googam] disconnected from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]],  
> channel closed event  
> [\<span style="color: #066;" class="styled-by-prettify"  
> ...

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2512ceda-0ca9-4d98-8748-6cd2df7f0865%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2512ceda-0ca9-4d98-8748-6cd2df7f0865%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Dario\_Rossi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dario_rossi/32/1672_2.png) [@Dario\_Rossi](https://discuss.elastic.co/u/Dario_Rossi)\
**Post date:** [April 1, 2014, 3:19pm UTC](https://discuss.elastic.co/t/elasticsearch-transportclient-throws-a-nonodeavailableexception-in-an-integration-test/16740/3 "2014-04-01T15:19:22Z")

</div>

The embedded data node uses port 11547 (this setting is working with a data  
less node without any problem).

Il giorno martedì 1 aprile 2014 16:15:57 UTC+1, IronMan2014 ha scritto:

> Is the transportclient working on port 9300 to begin with?
> 
> On Tuesday, April 1, 2014 11:04:43 AM UTC-4, Dario Rossi wrote:
> 
> > So I've a test where I try to connect to a local embedded Elasticsearch  
> > node that usually works with other tests. The embedded node is also local =  
> > true. It works in two other tests, one uses the HTTP Rest API and the other  
> > the data less node client. They both work good.
> > 
> > But when I try to use the TransportClient like this:
> > 
> > Settings settings = ImmutableSettings.settingsBuilder()  
> > .put("client.transport.ignore\_cluster\_name", false)  
> > .put("cluster.name", clusterName)  
> > .put("client.transport.sniff", false)  
> > .put("client.transport.ping\_timeout", pingTimeout)  
> > .put("client.transport.nodes\_sampler\_interval",pingSamplerInterval  
> > ).build();
> > 
> > ```
> > client = new TransportClient(settings);
> > 
> > String hostPieces[] = hosts.split(",");
> > for (String piece : hostPieces){
> > String hostAndPort[] = piece.trim().split(":");
> > if (hostAndPort.length != 2){
> > throw new IllegalArgumentException("Error in hosts 
> > 
> > ```
> > 
> > string: "+ piece);  
> > }  
> > String host = hostAndPort[0].trim();  
> > String portStr = hostAndPort[1].trim();
> > 
> > ```
> > InetSocketTransportAddress address = new 
> > 
> > ```
> > 
> > InetSocketTransportAddress(host, Integer.valueOf(portStr));
> > 
> > ```
> > client.addTransportAddress(address);
> > }
> > 
> > ```
> > 
> > although at the begging it seems to connect to the local node, then it  
> > dies:
> > 
> > [2014-04-01 15:31:21,504][DEBUG][org.elasticsearch.client.transport] [  
> > Googam] adding address [[  
> > #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> > [2014-04-01 15:31:21,517][DEBUG][org.elasticsearch.transport.netty] [  
> > Googam] connected to node [[  
> > #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> > [2014-04-01 15:31:31,316][DEBUG][org.elasticsearch.cluster.service] [  
> > Sepulchre] processing [routing-table-updater]: execute  
> > [2014-04-01 15:31:31,317][DEBUG][org.elasticsearch.cluster.service] [  
> > Sepulchre] processing [routing-table-updater]: no change in cluster\_state  
> > [2014-04-01 15:32:16,521][INFO][org.elasticsearch.client.transport] [  
> > Googam] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],  
> > disconnecting...  
> > org.elasticsearch.transport.ReceiveTimeoutTransportException: [inet[  
> > localhost/127.0.0.1:11547]][cluster/nodes/info] request\_id [0] timed outafter  
> > [55001ms]  
> > at org.elasticsearch.transport.TransportService$TimeoutHandler.run(  
> > TransportService.java:356)  
> > at java.util.concurrent.ThreadPoolExecutor.runWorker(  
> > ThreadPoolExecutor.java:1145)  
> > at java.util.concurrent.ThreadPoolExecutor$Worker.run(  
> > ThreadPoolExecutor.java:615)  
> > at java.lang.Thread.run(Thread.java:724)  
> > [2014-04-01 15:32:16,525][DEBUG][org.elasticsearch.transport.netty] [  
> > Googam] disconnected from [[  
> > #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> > [2014-04-01 15:32:16,527][DEBUG][org.elasticsearch.transport.netty] [  
> > Googam] connected to node [[  
> > #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> > [2014-04-01 15:32:16,530][INFO][org.elasticsearch.node] [Sepulchre]stopping  
> > ...  
> > [2014-04-01 15:32:16,530][DEBUG][org.elasticsearch.transport.netty] [  
> > Googam] disconnected from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]],  
> > channel closed event  
> > [\<span style="color: #066;" class="styled-by-prettify"  
> > ...

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e69a4b68-44ed-4daa-bba6-f1544b6e32a2%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e69a4b68-44ed-4daa-bba6-f1544b6e32a2%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![IronMike](https://avatars.discourse-cdn.com/v4/letter/i/e9a140/32.png) [@IronMike](https://discuss.elastic.co/u/IronMike)\
**Post date:** [April 1, 2014, 3:28pm UTC](https://discuss.elastic.co/t/elasticsearch-transportclient-throws-a-nonodeavailableexception-in-an-integration-test/16740/4 "2014-04-01T15:28:50Z")

</div>

Not sure, From my experience, there are two things to check, The client and  
server versions have to match and make sure ports are opened. Like I  
mentioned, check with 9300 to make sure it's working there at least.

On Tuesday, April 1, 2014 11:19:22 AM UTC-4, Dario Rossi wrote:

> The embedded data node uses port 11547 (this setting is working with a  
> data less node without any problem).
> 
> Il giorno martedì 1 aprile 2014 16:15:57 UTC+1, IronMan2014 ha scritto:
> 
> > Is the transportclient working on port 9300 to begin with?
> > 
> > On Tuesday, April 1, 2014 11:04:43 AM UTC-4, Dario Rossi wrote:
> > 
> > > So I've a test where I try to connect to a local embedded Elasticsearch  
> > > node that usually works with other tests. The embedded node is also local =  
> > > true. It works in two other tests, one uses the HTTP Rest API and the other  
> > > the data less node client. They both work good.
> > > 
> > > But when I try to use the TransportClient like this:
> > > 
> > > Settings settings = ImmutableSettings.settingsBuilder()  
> > > .put("client.transport.ignore\_cluster\_name", false)  
> > > .put("cluster.name", clusterName)  
> > > .put("client.transport.sniff", false)  
> > > .put("client.transport.ping\_timeout", pingTimeout)  
> > > .put("client.transport.nodes\_sampler\_interval",pingSamplerInterval  
> > > ).build();
> > > 
> > > ```
> > > client = new TransportClient(settings);
> > > 
> > > String hostPieces[] = hosts.split(",");
> > > for (String piece : hostPieces){
> > > String hostAndPort[] = piece.trim().split(":");
> > > if (hostAndPort.length != 2){
> > > throw new IllegalArgumentException("Error in hosts 
> > > 
> > > ```
> > > 
> > > string: "+ piece);  
> > > }  
> > > String host = hostAndPort[0].trim();  
> > > String portStr = hostAndPort[1].trim();
> > > 
> > > ```
> > > InetSocketTransportAddress address = new 
> > > 
> > > ```
> > > 
> > > InetSocketTransportAddress(host, Integer.valueOf(portStr));
> > > 
> > > ```
> > > client.addTransportAddress(address);
> > > }
> > > 
> > > ```
> > > 
> > > although at the begging it seems to connect to the local node, then it  
> > > dies:
> > > 
> > > [2014-04-01 15:31:21,504][DEBUG][org.elasticsearch.client.transport] [  
> > > Googam] adding address [[  
> > > #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> > > [2014-04-01 15:31:21,517][DEBUG][org.elasticsearch.transport.netty] [  
> > > Googam] connected to node [[  
> > > #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> > > [2014-04-01 15:31:31,316][DEBUG][org.elasticsearch.cluster.service] [  
> > > Sepulchre] processing [routing-table-updater]: execute  
> > > [2014-04-01 15:31:31,317][DEBUG][org.elasticsearch.cluster.service] [  
> > > Sepulchre] processing [routing-table-updater]: no change incluster\_state  
> > > [2014-04-01 15:32:16,521][INFO][org.elasticsearch.client.transport] [  
> > > Googam] failed to get node info for [#transport#-1][d][inet[localhost/127.0.0.1:11547]],  
> > > disconnecting...  
> > > org.elasticsearch.transport.ReceiveTimeoutTransportException: [inet[  
> > > localhost/127.0.0.1:11547]][cluster/nodes/info] request\_id [0] timed outafter  
> > > [55001ms]  
> > > at org.elasticsearch.transport.TransportService$TimeoutHandler.run(  
> > > TransportService.java:356)  
> > > at java.util.concurrent.ThreadPoolExecutor.runWorker(  
> > > ThreadPoolExecutor.java:1145)  
> > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(  
> > > ThreadPoolExecutor.java:615)  
> > > at java.lang.Thread.run(Thread.java:724)  
> > > [2014-04-01 15:32:16,525][DEBUG][org.elasticsearch.transport.netty] [  
> > > Googam] disconnected from [[  
> > > #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> > > [2014-04-01 15:32:16,527][DEBUG][org.elasticsearch.transport.netty] [  
> > > Googam] connected to node [[  
> > > #transport#-1][d][inet[localhost/127.0.0.1:11547]]]  
> > > [2014-04-01 15:32:16,530][INFO][org.elasticsearch.node] [Sepulchre]stopping  
> > > ...  
> > > [2014-04-01 15:32:16,530][DEBUG][org.elasticsearch.transport.netty] [  
> > > Googam] disconnected from [[#transport#-1][d][inet[localhost/127.0.0.1:11547]]],  
> > > channel closed event  
> > > [\<span style="color: #066;" class="styled-by-prettify"  
> > > ...

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/cf53efd0-5246-41ac-b35c-966d7cb5a5d0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/cf53efd0-5246-41ac-b35c-966d7cb5a5d0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 1:39am UTC](https://discuss.elastic.co/t/elasticsearch-transportclient-throws-a-nonodeavailableexception-in-an-integration-test/16740/5 "2017-07-06T01:39:00Z")

</div>


