# TransportClient and NoNodeAvailableException

**URL:** <https://discuss.elastic.co/t/transportclient-and-nonodeavailableexception/11880>\
**Category:** Elasticsearch\
**Created:** [May 8, 2013, 5:23pm UTC](https://discuss.elastic.co/t/transportclient-and-nonodeavailableexception/11880 "2013-05-08T17:23:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul\_Sanwald\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_sanwald_2/32/881_2.png) [@Paul\_Sanwald\_2](https://discuss.elastic.co/u/Paul_Sanwald_2)\
**Post date:** [May 8, 2013, 5:23pm UTC](https://discuss.elastic.co/t/transportclient-and-nonodeavailableexception/11880/1 "2013-05-08T17:23:25Z")

</div>

I have an application (a java jersey based REST service) that uses an  
ElasticSearch index; it fetches data out of ElasticSearch using a  
TransportClient to use as part of the data its serving.

My problem is that I have periodically gotten NoNodeAvailable exceptions  
when doing searches: there is retry logic and the query usually succeeds,  
but the retry costs me something in latency, and also just bothers me that  
I don't understand what's going on with the exceptions. I think the root  
cause may be in the way that I am using a transport client.

The way the application is currently built, we're using spring to  
instantiate our DAO classes, and each of these has a reference to a  
transport client. The transport client is re-used througout the life of the  
application. Should I instead be instantiating a new TransportClient on  
each search request? Does this matter?

If it matters, I've reproduced this problem on a 1 node cluster, where the  
client and the server are both on running on the same box. I use a  
relatively small amount of data in the index (1GB).

any thoughts or help would be much appreciated! Here's the stacktrace I get:

org.elasticsearch.client.transport.NoNodeAvailableException: No node  
available  
at  
org.elasticsearch.client.transport.TransportClientNodesService$RetryListener.onFailure(TransportClientNodesService.java:246)  
at  
org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:214)  
at  
org.elasticsearch.client.transport.support.InternalTransportClient.execute(InternalTransportClient.java:106)  
at  
org.elasticsearch.client.support.AbstractClient.search(AbstractClient.java:210)  
at  
org.elasticsearch.client.transport.TransportClient.search(TransportClient.java:388)  
at  
org.elasticsearch.action.search.SearchRequestBuilder.doExecute(SearchRequestBuilder.java:816)  
at  
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:62)  
at  
org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:57)  
  
at  
com.redowlanalytics.reference.dao.SearchIndexDAO.getSearchResponse(SearchIndexDAO.java:485)

--paul

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 8, 2013, 9:22pm UTC](https://discuss.elastic.co/t/transportclient-and-nonodeavailableexception/11880/2 "2013-05-08T21:22:17Z")

</div>

Do you use sniffing? And how many interface addresses do you connect to?  
Is the cluster name correct?  
I experienced this when TransportClient is set to snffing but ES cluster  
could not be reachable at all localhost/IPv4/IPv6 networks. One time I  
got disconnects because of cluster name mismatch or when cluster did not  
respond within 5 seconds, but that is easy to find out. Maybe you can  
try to turn sniffing off and focus on a single NIC only to be sure where  
the disconnect happens.

Jörg

Am 08.05.13 19:23, schrieb Paul Sanwald:

> org.elasticsearch.client.transport.NoNodeAvailableException: No node  
> available  
> at  
> org.elasticsearch.client.transport.TransportClientNodesService$RetryListener.onFailure(TransportClientNodesService.java:246)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Paul\_Sanwald\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_sanwald_2/32/881_2.png) [@Paul\_Sanwald\_2](https://discuss.elastic.co/u/Paul_Sanwald_2)\
**Post date:** [May 9, 2013, 7:43pm UTC](https://discuss.elastic.co/t/transportclient-and-nonodeavailableexception/11880/3 "2013-05-09T19:43:34Z")

</div>

Hi Jörg,  
I've pared it down to a single node, the cluster name is definitely  
correct as this works most of the time; I only get this error occasionally.  
I do have sniffing turned on, but could try disabling it.

for what it's worth, I've never been able to reproduce this on my local  
machine, so I suspect it might have something to do with discovery or the  
gateway, which I have configured as follows:  
discovery.type: ec2  
gateway.type: s3  
gateway.s3.bucket: ${elastic.search.s3.bucket}  
discovery.ec2.groups: ${elastic.search.discovery.group}

--paul

On Wednesday, May 8, 2013 5:22:17 PM UTC-4, Jörg Prante wrote:

> Do you use sniffing? And how many interface addresses do you connect to?  
> Is the cluster name correct?  
> I experienced this when TransportClient is set to snffing but ES cluster  
> could not be reachable at all localhost/IPv4/IPv6 networks. One time I  
> got disconnects because of cluster name mismatch or when cluster did not  
> respond within 5 seconds, but that is easy to find out. Maybe you can  
> try to turn sniffing off and focus on a single NIC only to be sure where  
> the disconnect happens.
> 
> Jörg
> 
> Am 08.05.13 19:23, schrieb Paul Sanwald:
> 
> > org.elasticsearch.client.transport.NoNodeAvailableException: No node  
> > available  
> > at
> 
> org.elasticsearch.client.transport.TransportClientNodesService$RetryListener.onFailure(TransportClientNodesService.java:246)

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 9, 2013, 7:53pm UTC](https://discuss.elastic.co/t/transportclient-and-nonodeavailableexception/11880/4 "2013-05-09T19:53:31Z")

</div>

I'm not using Amazon EC2 but I remember it might help to increase the  
default "ping.timeout" parameter from 5s up to a higher value.

Jörg

Am 09.05.13 21:43, schrieb Paul Sanwald:

> discovery.type: ec2  
> gateway.type: s3  
> gateway.s3.bucket: ${elastic.search.s3.bucket}  
> discovery.ec2.groups: ${elastic.search.discovery.group}

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Paul\_Sanwald\_2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/paul_sanwald_2/32/881_2.png) [@Paul\_Sanwald\_2](https://discuss.elastic.co/u/Paul_Sanwald_2)\
**Post date:** [May 9, 2013, 8:07pm UTC](https://discuss.elastic.co/t/transportclient-and-nonodeavailableexception/11880/5 "2013-05-09T20:07:34Z")

</div>

do you mean  
discovery.zen.ping\_timeout, or client.transport.ping\_timeout?

I would assume the latter, but wanted to verify.

--paul

On Thursday, May 9, 2013 3:53:31 PM UTC-4, Jörg Prante wrote:

> I'm not using Amazon EC2 but I remember it might help to increase the  
> default "ping.timeout" parameter from 5s up to a higher value.
> 
> Jörg
> 
> Am 09.05.13 21:43, schrieb Paul Sanwald:
> 
> > discovery.type: ec2  
> > gateway.type: s3  
> > gateway.s3.bucket: ${elastic.search.s3.bucket}  
> > discovery.ec2.groups: ${elastic.search.discovery.group}

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [May 9, 2013, 8:12pm UTC](https://discuss.elastic.co/t/transportclient-and-nonodeavailableexception/11880/6 "2013-05-09T20:12:44Z")

</div>

client.transport.ping\_timeout

If that does not help, you should check what happened to the node you  
try to connect to (OOM, disk full, long GC, just to name a few  
catastrophic events)

Jörg

Am 09.05.13 22:07, schrieb Paul Sanwald:

> do you mean  
> discovery.zen.ping\_timeout, or client.transport.ping\_timeout?
> 
> I would assume the latter, but wanted to verify.
> 
> --paul
> 
> On Thursday, May 9, 2013 3:53:31 PM UTC-4, Jörg Prante wrote:
> 
> ```
> I'm not using Amazon EC2 but I remember it might help to increase the
> default "ping.timeout" parameter from 5s up to a higher value.
> 
> Jörg
> 
> Am 09.05.13 21:43, schrieb Paul Sanwald:
> > discovery.type: ec2
> > gateway.type: s3
> > gateway.s3.bucket: ${elastic.search.s3.bucket}
> > discovery.ec2.groups: ${elastic.search.discovery.group}
> 
> ```
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:37am UTC](https://discuss.elastic.co/t/transportclient-and-nonodeavailableexception/11880/7 "2017-07-06T02:37:16Z")

</div>


