# Java program failing with None of the configured nodes are available

**URL:** https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318
**Category:** Elasticsearch
**Created:** [October 18, 2016, 6:30pm UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318 "2016-10-18T18:30:35Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![gundaldo](https://avatars.discourse-cdn.com/v4/letter/g/5fc32e/32.png) [@gundaldo](https://discuss.elastic.co/u/gundaldo)
#### Post date: [October 18, 2016, 6:30pm UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318/1 "2016-10-18T18:30:35Z")

</div>

Hi,

I'm new to Elastic search. I have 2 servers one server where Elasticsearch is configured and while other server is having java client installed. When trying to access Elasticsearch from Java program it is erroring out saying

None of the configured nodes are available: [{#transport#-1}{_._._._}{_._._._:9200}

Initially we thought firewalls but we have opened ports 9200, 9300 but still facing same issue. The same java program works if we have Elasticsearch installed locally.

Do you think it is still a firewall issue? If So please let me know what all ports need to be opened for Java program to work.

Thanks

---

<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: [October 18, 2016, 6:47pm UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318/2 "2016-10-18T18:47:30Z")

</div>

Share your code and settings. Hard to tell here.

That said make sure you are using port 9300 from the client.

---

<div class="post-metadata">

### Author: ![gundaldo](https://avatars.discourse-cdn.com/v4/letter/g/5fc32e/32.png) [@gundaldo](https://discuss.elastic.co/u/gundaldo)
#### Post date: [October 18, 2016, 6:53pm UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318/3 "2016-10-18T18:53:47Z")

</div>

Thanks David for your response.

Do you need entire code or just part of it?

---

<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: [October 18, 2016, 7:14pm UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318/4 "2016-10-18T19:14:49Z")

</div>

The code which creates the transport client.

---

<div class="post-metadata">

### Author: ![gundaldo](https://avatars.discourse-cdn.com/v4/letter/g/5fc32e/32.png) [@gundaldo](https://discuss.elastic.co/u/gundaldo)
#### Post date: [October 18, 2016, 9:02pm UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318/5 "2016-10-18T21:02:32Z")

</div>

Settings settings =  
Settings.settingsBuilder().put("[cluster.name](http://cluster.name)", clusterName).build();  
Client client =  
TransportClient  
.builder()  
.settings(settings)  
.build()  
.addTransportAddress(  
new InetSocketTransportAddress(InetAddress.getByName(host), port)  
);

---

<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: [October 19, 2016, 5:14am UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318/6 "2016-10-19T05:14:18Z")

</div>

What do you have in port?

Also did you define network.host on the server?

---

<div class="post-metadata">

### Author: ![anishm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anishm/32/28796_2.png) [@anishm](https://discuss.elastic.co/u/anishm)
#### Post date: [October 19, 2016, 5:30am UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318/7 "2016-10-19T05:30:32Z")

</div>

I have a similar problem. However, my Elasticsearch is on 2.4 while I am using the API v2.3.3. Can this be the cause?

---

<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: [October 19, 2016, 6:21am UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318/8 "2016-10-19T06:21:17Z")

</div>

I believe it should be compatible but the best practice for the transport client is to use same version as the server.

---

<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 5, 2017, 10:11pm UTC](https://discuss.elastic.co/t/java-program-failing-with-none-of-the-configured-nodes-are-available/63318/9 "2017-07-05T22:11:26Z")

</div>


