# Cluster Name in Java Client ends up in No Node Available Exception

**URL:** <https://discuss.elastic.co/t/cluster-name-in-java-client-ends-up-in-no-node-available-exception/106871>\
**Category:** Elasticsearch\
**Created:** [November 8, 2017, 1:29pm UTC](https://discuss.elastic.co/t/cluster-name-in-java-client-ends-up-in-no-node-available-exception/106871 "2017-11-08T13:29:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahesh.maney](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@mahesh.maney](https://discuss.elastic.co/u/mahesh.maney)\
**Post date:** [November 8, 2017, 1:29pm UTC](https://discuss.elastic.co/t/cluster-name-in-java-client-ends-up-in-no-node-available-exception/106871/1 "2017-11-08T13:29:39Z")

</div>

We have a java client(1.3) that talks to elasticsearch(1.3) in our application.

```
try {
	((TransportClient) this.client).addTransportAddress(
			new InetSocketTransportAddress(InetAddress.getByName("local"), 9300));
} catch (UnknownHostException e) {
	LOGGER.error(e.getMessage(),e);
}

and our elasticsearch.yml file content is :
	
	cluster.name: 'elasticsearch'
	node.name: 'localhost'
	path.data: /home/vagrant/elasticsearch/data
	path.logs: /home/vagrant/elasticsearch/logs
	network.host: 0.0.0.0
	transport.tcp.port: 9300
	http.port: 9200
	indices.query.bool.max_clause_count: 10240

```

The Java client was able to talk to Elasticsearch and perform the requested operation. All fine till here

```
 We migrated to Elasticsearch 5.5 and now the java client looks like :

public TransportClient getTransportClient() {
	TransportClient client = new PreBuiltTransportClient(Settings.EMPTY);
	return client;
}

try {
	((TransportClient) this.client).addTransportAddress(
			new InetSocketTransportAddress(InetAddress.getByName("local"), 9300));
} catch (UnknownHostException e) {
	LOGGER.error(e.getMessage(),e);
}

and our elasticsearch.yml looks like the same as 1.3 except for the cluster name.
We changed the cluster.name to elasticsearch-cluster. 
Now the java client is not able to talk to elasticsearch.
we get "no node avaliable exception". 
Can someone please suggest, as to, what we need to modify here ?

Regards,
Maney
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [November 8, 2017, 2:49pm UTC](https://discuss.elastic.co/t/cluster-name-in-java-client-ends-up-in-no-node-available-exception/106871/2 "2017-11-08T14:49:41Z")

</div>

Please try to have a better formatting of your posts. basically 4 spaces before a line is like posting code. You can see that in the preview window. Thanks.

Can you share what are your elasticsearch logs when it starts please?  
Typically what is the IP address of the transport layer.  
Try to use it instead of `InetAddress.getByName("local")` and see if it changes anything.

If running on Windows, check that no firewall is blocking the ports.

---

<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:** [December 6, 2017, 2:50pm UTC](https://discuss.elastic.co/t/cluster-name-in-java-client-ends-up-in-no-node-available-exception/106871/3 "2017-12-06T14:50:23Z")

</div>

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