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

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

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.

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