# ES 1.4.2 - MasterNotDiscovered Exception with Java Node Client

**URL:** https://discuss.elastic.co/t/es-1-4-2-masternotdiscovered-exception-with-java-node-client/21938
**Category:** Elasticsearch
**Created:** [January 31, 2015, 7:26pm UTC](https://discuss.elastic.co/t/es-1-4-2-masternotdiscovered-exception-with-java-node-client/21938 "2015-01-31T19:26:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Stefan\_Meiwald](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Stefan\_Meiwald](https://discuss.elastic.co/u/Stefan_Meiwald)
#### Post date: [January 31, 2015, 7:26pm UTC](https://discuss.elastic.co/t/es-1-4-2-masternotdiscovered-exception-with-java-node-client/21938/1 "2015-01-31T19:26:25Z")

</div>

I am trying to connect with a Java application from localhost to my  
elasticsearch cluster on a root server. My problem is that the java client  
is not able to get a connection.

Ports 9200-9299 and 9300-9400 are opened on the root server(groupelite.de).

I configured my elasticsearch cluster to use unicast discovery and set its  
inet ip address as "network.host".  
This is how I instantiate my client:

```
NodeBuilder.nodeBuilder()
  .clusterName("neeedo-es")
  .settings(ImmutableSettings.settingsBuilder()
    .classLoader(classOf[Settings].getClassLoader)
    .put("discovery.zen.ping.unicast.hosts", "groupelite.de:9300")
    .put("node.name", "neeedo-client"))
  .client(true)
  .data(false)
  .node()

```

And this is my elasticsearch.yml

> <https://gist.github.com/MeiSign/ccfdcc62643c1185bab3>

The firewall on the server should be turned off. You can also reach es with  
http:  
[http://www.groupelite.de:9200/](http://www.groupelite.de:9200/)

The server is running ubuntu 14.04. Elasticsearch version is 1.4.2 on  
client and server.

Iam not very used to networking stuff but I hope to get some ideas from you  
guys what is wrong.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [January 31, 2015, 11:09pm UTC](https://discuss.elastic.co/t/es-1-4-2-masternotdiscovered-exception-with-java-node-client/21938/2 "2015-01-31T23:09:09Z")

</div>

DO NOT leave your cluster open to anyone on the internet, this is a REALLY  
BAD idea!!

On 1 February 2015 at 06:26, Stefan Meiwald [st.meiwald@gmail.com](mailto:st.meiwald@gmail.com) wrote:

> I am trying to connect with a Java application from localhost to my  
> elasticsearch cluster on a root server. My problem is that the java client  
> is not able to get a connection.
> 
> Ports 9200-9299 and 9300-9400 are opened on the root server([groupelite.de](http://groupelite.de)  
> ).
> 
> I configured my elasticsearch cluster to use unicast discovery and set its  
> inet ip address as "network.host".  
> This is how I instantiate my client:
> 
> ```
> NodeBuilder.nodeBuilder()
> .clusterName("neeedo-es")
> .settings(ImmutableSettings.settingsBuilder()
> .classLoader(classOf[Settings].getClassLoader)
> .put("discovery.zen.ping.unicast.hosts", "groupelite.de:9300")
> .put("node.name", "neeedo-client"))
> .client(true)
> .data(false)
> .node()
> 
> ```
> 
> And this is my elasticsearch.yml  
> [elasticsearch.yml · GitHub](https://gist.github.com/MeiSign/ccfdcc62643c1185bab3)
> 
> The firewall on the server should be turned off. You can also reach es  
> with http:  
> [http://www.groupelite.de:9200/](http://www.groupelite.de:9200/)
> 
> The server is running ubuntu 14.04. Elasticsearch version is 1.4.2 on  
> client and server.
> 
> Iam not very used to networking stuff but I hope to get some ideas from  
> you guys what is wrong.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-203b9qT2JQCo8kES6h%2BNrbj2JF6Zx1nS0QLm4OUUw7g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEYi1X-203b9qT2JQCo8kES6h%2BNrbj2JF6Zx1nS0QLm4OUUw7g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Stefan\_Meiwald](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Stefan\_Meiwald](https://discuss.elastic.co/u/Stefan_Meiwald)
#### Post date: [January 31, 2015, 11:12pm UTC](https://discuss.elastic.co/t/es-1-4-2-masternotdiscovered-exception-with-java-node-client/21938/3 "2015-01-31T23:12:14Z")

</div>

There is no data on it right now and also only limited diskspace for es. I  
am planning to tryout Shield and will secure it later on. But first of all  
I want to be able to get a connection to it. :-/  
Anyways thanks for your advice.

Am Sonntag, 1. Februar 2015 00:09:42 UTC+1 schrieb Mark Walkom:

> DO NOT leave your cluster open to anyone on the internet, this is a REALLY  
> BAD idea!!
> 
> On 1 February 2015 at 06:26, Stefan Meiwald \<[st.me...@gmail.com](mailto:st.me...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > I am trying to connect with a Java application from localhost to my  
> > elasticsearch cluster on a root server. My problem is that the java client  
> > is not able to get a connection.
> > 
> > Ports 9200-9299 and 9300-9400 are opened on the root server([groupelite.de](http://groupelite.de)  
> > ).
> > 
> > I configured my elasticsearch cluster to use unicast discovery and set  
> > its inet ip address as "network.host".  
> > This is how I instantiate my client:
> > 
> > ```
> > NodeBuilder.nodeBuilder()
> > .clusterName("neeedo-es")
> > .settings(ImmutableSettings.settingsBuilder()
> > .classLoader(classOf[Settings].getClassLoader)
> > .put("discovery.zen.ping.unicast.hosts", "groupelite.de:9300")
> > .put("node.name", "neeedo-client"))
> > .client(true)
> > .data(false)
> > .node()
> > 
> > ```
> > 
> > And this is my elasticsearch.yml  
> > [elasticsearch.yml · GitHub](https://gist.github.com/MeiSign/ccfdcc62643c1185bab3)
> > 
> > The firewall on the server should be turned off. You can also reach es  
> > with http:  
> > [http://www.groupelite.de:9200/](http://www.groupelite.de:9200/)
> > 
> > The server is running ubuntu 14.04. Elasticsearch version is 1.4.2 on  
> > client and server.
> > 
> > Iam not very used to networking stuff but I hope to get some ideas from  
> > you guys what is wrong.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/938933de-6f67-4dd3-ab93-8f42863b3ff9%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ef605be0-adfb-4401-ad85-918c5d660ec0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ef605be0-adfb-4401-ad85-918c5d660ec0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Stefan\_Meiwald](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Stefan\_Meiwald](https://discuss.elastic.co/u/Stefan_Meiwald)
#### Post date: [February 2, 2015, 12:22pm UTC](https://discuss.elastic.co/t/es-1-4-2-masternotdiscovered-exception-with-java-node-client/21938/4 "2015-02-02T12:22:50Z")

</div>

I have found out, that it works when I use a Transport Client. Does this  
give any hint what is wrong with the Node Client Configuration? Both  
clients are using the elasticsearch binary protocol and port 9300 right?

Am Samstag, 31. Januar 2015 20:26:25 UTC+1 schrieb Stefan Meiwald:

> I am trying to connect with a Java application from localhost to my  
> elasticsearch cluster on a root server. My problem is that the java client  
> is not able to get a connection.
> 
> Ports 9200-9299 and 9300-9400 are opened on the root server([groupelite.de](http://groupelite.de)  
> ).
> 
> I configured my elasticsearch cluster to use unicast discovery and set its  
> inet ip address as "network.host".  
> This is how I instantiate my client:
> 
> ```
> NodeBuilder.nodeBuilder()
> .clusterName("neeedo-es")
> .settings(ImmutableSettings.settingsBuilder()
> .classLoader(classOf[Settings].getClassLoader)
> .put("discovery.zen.ping.unicast.hosts", "groupelite.de:9300")
> .put("node.name", "neeedo-client"))
> .client(true)
> .data(false)
> .node()
> 
> ```
> 
> And this is my elasticsearch.yml  
> [elasticsearch.yml · GitHub](https://gist.github.com/MeiSign/ccfdcc62643c1185bab3)
> 
> The firewall on the server should be turned off. You can also reach es  
> with http:  
> [http://www.groupelite.de:9200/](http://www.groupelite.de:9200/)
> 
> The server is running ubuntu 14.04. Elasticsearch version is 1.4.2 on  
> client and server.
> 
> Iam not very used to networking stuff but I hope to get some ideas from  
> you guys what is wrong.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d5681c2c-6a34-437b-b9ac-c0074435c64a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d5681c2c-6a34-437b-b9ac-c0074435c64a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:35am UTC](https://discuss.elastic.co/t/es-1-4-2-masternotdiscovered-exception-with-java-node-client/21938/5 "2017-07-06T00:35:21Z")

</div>


