# Elasticsearch occur NoNodeAvailableException

**URL:** <https://discuss.elastic.co/t/elasticsearch-occur-nonodeavailableexception/200777>\
**Category:** Elasticsearch\
**Created:** [September 24, 2019, 3:57am UTC](https://discuss.elastic.co/t/elasticsearch-occur-nonodeavailableexception/200777 "2019-09-24T03:57:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lurongjiang](https://avatars.discourse-cdn.com/v4/letter/l/53a042/32.png) [@lurongjiang](https://discuss.elastic.co/u/lurongjiang)\
**Post date:** [September 24, 2019, 3:57am UTC](https://discuss.elastic.co/t/elasticsearch-occur-nonodeavailableexception/200777/1 "2019-09-24T03:57:58Z")

</div>

above all:

- the version of elasticsearch: 5.6.1
- cluster nodes: six

when the six nodes were well,everything is ok

after kill the 3 data nodes , nothing happened;

but the second day,I found the error log for my application:NoNodeAvailableException

I check the cluster state,the left three nodes all are ok,but cannot connect to;

when resstart the tomcat,everything is ok,I wander to know what's reason for the problem

I already got the error several times.....

the part logs:

```auto

[Request processing failed; nested exception is NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{95EkhGDNRkGq35VqnHlRog}{xx.xx.xx.xx}{xx.xx.xx.xx:9300}, {#transport#-2}{8urxHInyRBmRXf80dudBgg}{xx.xx.xx.xx}{xx.xx.xx.xx:9300}, {#transport#-3}{vCXX4k-GRlKrg-_hhX1QyA}{xx.xx.xx.xx}{xx.xx.xx.xx:9300}]]] with root cause
NoNodeAvailableException[None of the configured nodes are available: [{#transport#-1}{95EkhGDNRkGq35VqnHlRog}{xx.xx.xx.xx}{xx.xx.xx.xx:9300}, {#transport#-2}{8urxHInyRBmRXf80dudBgg}{xx.xx.xx.xx}{xx.xx.xx.xx:9300}, {#transport#-3}{vCXX4k-GRlKrg-_hhX1QyA}{xx.xx.xx.xx}{xx.xx.xx.xx:9300}]]] with root cause
	at org.elasticsearch.client.transport.TransportClientNodesService.ensureNodesAreAvailable(TransportClientNodesService.java:347)
	at org.elasticsearch.client.transport.TransportClientNodesService.execute(TransportClientNodesService.java:245)
	at org.elasticsearch.client.transport.TransportProxyClient.execute(TransportProxyClient.java:59)
	at org.elasticsearch.client.transport.TransportClient.doExecute(TransportClient.java:363)
	at org.elasticsearch.client.support.AbstractClient.execute(AbstractClient.java:408)
	at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:80)
	at org.elasticsearch.action.ActionRequestBuilder.execute(ActionRequestBuilder.java:54)

```

the code connect to server:

```java
public static TransportClient getClient() {
	if (client == null) {
		try {
			Settings settings = Settings.builder().put("cluster.name", clusterName).put("client.transport.sniff", true)
			.put("transport.type", "netty3").put("http.type", "netty3").build();
			client = new PreBuiltTransportClient(settings);
			String[] addresses = esServers.split(",");
			for (String address : addresses) {
				String[] hostInfo = address.split(":");
				client.addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName(hostInfo[0]), Integer.parseInt(hostInfo[1])));
			}
		} catch (Exception e) {
			logger.error("get client fail...", e);
			shutdown();
			client = null;
		}
	}
	logger.debug("create client is successful ");
	return 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:** [October 22, 2019, 3:58am UTC](https://discuss.elastic.co/t/elasticsearch-occur-nonodeavailableexception/200777/2 "2019-10-22T03:58:08Z")

</div>

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