# Sudden no node available exception

**URL:** <https://discuss.elastic.co/t/sudden-no-node-available-exception/11414>\
**Category:** Elasticsearch\
**Created:** [April 2, 2013, 4:14pm UTC](https://discuss.elastic.co/t/sudden-no-node-available-exception/11414 "2013-04-02T16:14:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![john\_2](https://avatars.discourse-cdn.com/v4/letter/j/dc4da7/32.png) [@john\_2](https://discuss.elastic.co/u/john_2)\
**Post date:** [April 2, 2013, 4:14pm UTC](https://discuss.elastic.co/t/sudden-no-node-available-exception/11414/1 "2013-04-02T16:14:38Z")

</div>

Hi,

I'm getting these sudden no node available exceptions and they continue to  
persist over multiple calls untill the elastic search server or apache  
tomcat is restarted. Below is how i'm getting the client and running the  
query. I've just kept the relevant things in the code below.

Pls let me know if anyone has faced this issue. Apparently there are a lot  
of posts related to this issue but none of them gave me a clear idea.

private static Client getClient(UserRequest userRequest,Map\<String, String\>credentialMap  
)  
{  
if(null==client) // client is a static instance variable  
{  
Settings settings = ImmutableSettings.settingsBuilder()  
.put("cluster.name", credentialMap.get(ES\_CLUSTER))  
.put("client.transport.sniff", true)  
.put("node.client", true)  
.put("client.transport.ping\_timeout","10s").build();

client = new TransportClient(settings).addTransportAddress(new  
InetSocketTransportAddress(credentialMap.get(ES\_HOST), Integer.parseInt(  
credentialMap.get(ES\_JAVA\_PORT))));  
}  
return client;  
}

protected SearchResponse runJavaApiQuery(SearchRequestBuilder srb)  
{  
return srb.execute().actionGet();  
}

protected SearchRequestBuilder getSearchRequestBuilder(QueryBuilderqueryBuilder  
, UserRequest userRequest,Map\<String, String\> credentialMap)  
{  
return getClient(userRequest,credentialMap).prepareSearch(credentialMap.get  
(ES\_INDEX)).setSearchType(SearchType.QUERY\_THEN\_FETCH).setQuery(queryBuilder  
);  
}

Thanks,  
john

--  
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:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [April 3, 2013, 2:18pm UTC](https://discuss.elastic.co/t/sudden-no-node-available-exception/11414/2 "2013-04-03T14:18:54Z")

</div>

On Tue, 2013-04-02 at 09:14 -0700, john wrote:

> Hi,
> 
> I'm getting these sudden no node available exceptions and they  
> continue to persist over multiple calls untill the Elasticsearch  
> server or apache tomcat is restarted. Below is how i'm getting the  
> client and running the query. I've just kept the relevant things in  
> the code below.

What's in the logs is surely going to be more useful when answering the  
question: why are my nodes no longer available?

no?

clint

--  
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:43am UTC](https://discuss.elastic.co/t/sudden-no-node-available-exception/11414/3 "2017-07-06T02:43:02Z")

</div>


