# Issue with NoNodeAvailableException\[None of the configured nodes are available:

**URL:** <https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314>\
**Category:** Elasticsearch\
**Created:** [August 5, 2016, 8:05am UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314 "2016-08-05T08:05:28Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![cachito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cachito/32/11221_2.png) [@cachito](https://discuss.elastic.co/u/cachito)\
**Post date:** [August 5, 2016, 8:05am UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/1 "2016-08-05T08:05:28Z")

</div>

Hi

I am developing my first Java client to access ES but got the _NoNodeAvailableException[None of the configured nodes are available:_ error when try it and the issue is driving me crazy.

What I am doing is:

Settings settings = Settings.settingsBuilder()  
.put("[cluster.name](http://cluster.name)", "mycluster")  
.put("client.transport.ping\_timeout", "30s")  
.build();

```
    Client client = null;
    try {
        client = TransportClient.builder().settings(settings)
                .build()
                .addTransportAddress(new InetSocketTransportAddress(InetAddress.getByName("myservername"), 9300)); // INT

        IndexRequestBuilder prepareIndex = client.prepareIndex("*", "log");

        ListenableActionFuture<IndexResponse> execute = prepareIndex.execute(); 

    } catch (UnknownHostException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }

```

I have tried to increase the timeout even to 30 seconds but no success.  
I saw on the net that a lot of people have had this problem but got no solution valid for me.

Thanks in advance.

PD: I actually used proper values on mycluster and myservername so this is not the error source.

---

<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:** [August 5, 2016, 8:20am UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/2 "2016-08-05T08:20:08Z")

</div>

Please format your code using `</>` icon. It will make your post more readable.

Common mistakes:

- Forgot to define `network.host` on the machine
- `cluster.name` changed
- Firewall issues with port 9300

...

---

<div class="post-metadata">

**Author:** ![cachito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cachito/32/11221_2.png) [@cachito](https://discuss.elastic.co/u/cachito)\
**Post date:** [August 5, 2016, 9:20am UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/3 "2016-08-05T09:20:04Z")

</div>

Hi

Thanks for your reply.

I am sure that [cluster.name](http://cluster.name) remains unchanged.  
What do you mean with network.host? Is it a property that I should add on my java code?

BTW: is there any special property that should I set on server to allow my java client that is placed out of the Elasticsearch server could get connected? Any property that should I check?

Thanks in advance.

---

<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:** [August 5, 2016, 11:24am UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/4 "2016-08-05T11:24:45Z")

</div>

I meant this: [Network Settings | Elasticsearch Guide [2.3] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-network.html#common-network-settings)

Must be added on your nodes if you want them to be reachable from outside your server.

> [@cachito](#):
>
> BTW: is there any special property that should I set on server to allow my java client that is placed out of the Elasticsearch server could get connected? Any property that should I check?

No. If you want to secure the transport layer, you need to use Shield / X-Pack (commercial subscription).

Note that in the next future, a REST java client will be released within 5.0. You can use it with elasticsearch 2.x as well.  
Then you could add a NGinx layer to secure it. Still I think it would be much easier and with many other features OOTB to use X-Pack.

---

<div class="post-metadata">

**Author:** ![cachito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cachito/32/11221_2.png) [@cachito](https://discuss.elastic.co/u/cachito)\
**Post date:** [August 5, 2016, 11:39am UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/5 "2016-08-05T11:39:10Z")

</div>

Thanks.

Seems that my problem is that I am trying to access the Amazon service instead of a real Elasticsearch running on an EC2 instance.

I was unable to find other way to access such service than the Kibana console.....

---

<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:** [August 5, 2016, 12:00pm UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/6 "2016-08-05T12:00:16Z")

</div>

Oh? You are using Amazon Elasticsearch service?  
AFAIK you can't do it with the transport client. Not sure they changed that.

Did you look at [https://www.elastic.co/cloud](https://www.elastic.co/cloud) by any chance?  
It works with TransportClient and security OOTB.

Disclaimer: I work at elastic.

---

<div class="post-metadata">

**Author:** ![cachito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cachito/32/11221_2.png) [@cachito](https://discuss.elastic.co/u/cachito)\
**Post date:** [August 8, 2016, 6:25am UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/7 "2016-08-08T06:25:27Z")

</div>

Hi

Well, my advise was to use ELK but somebody else decided to use the AWS Elasticsearch service... 🙂

However, I wonder if it is possible to consume data from the Elasticsearch REST service from a Java application. I mean: is there a way to make specific queries to such service? Guide? Examples?

Thanks in advance.

---

<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:** [August 8, 2016, 8:38am UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/8 "2016-08-08T08:38:25Z")

</div>

You can wait for the Java REST client to be released. [https://github.com/elastic/elasticsearch/tree/master/client/rest](https://github.com/elastic/elasticsearch/tree/master/client/rest)  
There are already some alpha versions but not ready for production.  
It's a low level client though. [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/index.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/index.html)

Also JEST: [https://github.com/searchbox-io/Jest](https://github.com/searchbox-io/Jest) could help you.

---

<div class="post-metadata">

**Author:** ![cachito](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cachito/32/11221_2.png) [@cachito](https://discuss.elastic.co/u/cachito)\
**Post date:** [August 8, 2016, 9:28am UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/9 "2016-08-08T09:28:08Z")

</div>

Perfect.  
Thank you!

---

<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:29pm UTC](https://discuss.elastic.co/t/issue-with-nonodeavailableexception-none-of-the-configured-nodes-are-available/57314/10 "2017-07-05T22:29:26Z")

</div>


