# Node client cannot connect to cluster

**URL:** https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770
**Category:** Elasticsearch
**Created:** [September 26, 2013, 6:45pm UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770 "2013-09-26T18:45:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![peter2](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@peter2](https://discuss.elastic.co/u/peter2)
#### Post date: [September 26, 2013, 6:45pm UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/1 "2013-09-26T18:45:52Z")

</div>

I'm trying to configure node client to connect to an elasticsearch cluster  
that does not use multicast, but I'm running into problems. Also I'm  
providing all settings programmatically to the NodeClient as I cannot use  
an elasticsearch.yml file (mainly because cluster names and unicast hosts  
names are different across environments and I don't know how to tell node  
client to use a different yml file based on environment).

Using es 0.90.5, I have configured it as follows (no yml file, just this  
config) -

```
  Settings settings = ImmutableSettings.builder()
    .put("discovery.zen.ping.multicast.enabled", "false")
    .put("discovery.zen.ping.unicast.hosts", "es-a-qa-1, es-b-qa-1")
    .put("cluster.name", "search-0.90.5-1-qa")
    .build();

  Node node = 

```

nodeBuilder().client(true).loadConfigSettings(false).settings(settings).node();

But I get the following error.

30905 [elasticsearch[Courier][generic][T#1]] INFO  
org.elasticsearch.discovery.zen - [Courier] failed to send join request  
to master  
[[es-a-qa-1][KqQ1sm7GTH2obZ6Vx-Sjog][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}],  
reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting  
for task.]

I can connect to both es-a-qa-1 and es-b-qa-1 nodes via telnet on 9300 and  
9200 ports.

What am I doing wrong?

Thanks  
Peter

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![peter2](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@peter2](https://discuss.elastic.co/u/peter2)
#### Post date: [October 19, 2013, 2:49pm UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/2 "2013-10-19T14:49:59Z")

</div>

Can anyone help? Does nobody know how to do this? Would really appreciate  
it.

On Thursday, September 26, 2013 2:45:52 PM UTC-4, [pe...@vagaband.co](mailto:pe...@vagaband.co) wrote:

> I'm trying to configure node client to connect to an elasticsearch cluster  
> that does not use multicast, but I'm running into problems. Also I'm  
> providing all settings programmatically to the NodeClient as I cannot use  
> an elasticsearch.yml file (mainly because cluster names and unicast hosts  
> names are different across environments and I don't know how to tell node  
> client to use a different yml file based on environment).
> 
> Using es 0.90.5, I have configured it as follows (no yml file, just this  
> config) -
> 
> ```
> Settings settings = ImmutableSettings.builder()
> .put("discovery.zen.ping.multicast.enabled", "false")
> .put("discovery.zen.ping.unicast.hosts", "es-a-qa-1, es-b-qa-1")
> .put("cluster.name", "search-0.90.5-1-qa")
> .build();
> 
> Node node = 
> 
> ```
> 
> nodeBuilder().client(true).loadConfigSettings(false).settings(settings).node();
> 
> But I get the following error.
> 
> 30905 [elasticsearch[Courier][generic][T#1]] INFO  
> org.elasticsearch.discovery.zen - [Courier] failed to send join request  
> to master  
> [[es-a-qa-1][KqQ1sm7GTH2obZ6Vx-Sjog][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}],  
> reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting  
> for task.]
> 
> I can connect to both es-a-qa-1 and es-b-qa-1 nodes via telnet on 9300 and  
> 9200 ports.
> 
> What am I doing wrong?
> 
> Thanks  
> Peter

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2013, 5:19pm UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/3 "2013-10-19T17:19:43Z")

</div>

Try

discovery.zen.ping.unicast.hosts", "es-a-qa-1:9300, es-b-qa-1:9300")

## Does it help?

David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 19 oct. 2013 à 16:49, "[peter@vagaband.co](mailto:peter@vagaband.co)" [peter@vagaband.co](mailto:peter@vagaband.co) a écrit :

> Can anyone help? Does nobody know how to do this? Would really appreciate it.
> 
> On Thursday, September 26, 2013 2:45:52 PM UTC-4, [pe...@vagaband.co](mailto:pe...@vagaband.co) wrote:
> 
> > I'm trying to configure node client to connect to an elasticsearch cluster that does not use multicast, but I'm running into problems. Also I'm providing all settings programmatically to the NodeClient as I cannot use an elasticsearch.yml file (mainly because cluster names and unicast hosts names are different across environments and I don't know how to tell node client to use a different yml file based on environment).
> > 
> > Using es 0.90.5, I have configured it as follows (no yml file, just this config) -
> > 
> > ```
> > Settings settings = ImmutableSettings.builder()
> > .put("discovery.zen.ping.multicast.enabled", "false")
> > .put("discovery.zen.ping.unicast.hosts", "es-a-qa-1, es-b-qa-1")
> > .put("cluster.name", "search-0.90.5-1-qa")
> > .build();
> > 
> > Node node = nodeBuilder().client(true).loadConfigSettings(false).settings(settings).node();
> > 
> > ```
> > 
> > But I get the following error.
> > 
> > 30905 [elasticsearch[Courier][generic][T#1]] INFO org.elasticsearch.discovery.zen - [Courier] failed to send join request to master [[es-a-qa-1][KqQ1sm7GTH2obZ6Vx-Sjog][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}], reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting for task.]
> > 
> > I can connect to both es-a-qa-1 and es-b-qa-1 nodes via telnet on 9300 and 9200 ports.
> > 
> > What am I doing wrong?
> > 
> > Thanks  
> > Peter
> 
> --  
> 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).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![peter2](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@peter2](https://discuss.elastic.co/u/peter2)
#### Post date: [October 19, 2013, 7:51pm UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/4 "2013-10-19T19:51:43Z")

</div>

Yeah, using the port did not help. I am able to telnet to these machines to  
9300, so it's not a firewall issue.

3686 [main] INFO org.elasticsearch.node - [Steven Lang] version[0.90.5],  
pid[3861], build[c8714e8/2013-09-17T12:50:20Z]  
3686 [main] INFO org.elasticsearch.node - [Steven Lang] initializing ...  
3691 [main] INFO org.elasticsearch.plugins - [Steven Lang] loaded [],  
sites []  
4789 [main] INFO org.elasticsearch.node - [Steven Lang] initialized  
4789 [main] INFO org.elasticsearch.node - [Steven Lang] starting ...  
4852 [main] INFO org.elasticsearch.transport - [Steven Lang]  
bound\_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish\_address  
{inet[/10.0.1.9:9300]}  
10908 [elasticsearch[Steven Lang][generic][T#1]] INFO  
org.elasticsearch.discovery.zen - [Steven Lang] failed to send join  
request to master  
[[es-a-qa-1][230ODTyvQnSQ-ZmdE0Z94A][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}],  
reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting  
for task.]  
16936 [elasticsearch[Steven Lang][generic][T#1]] INFO  
org.elasticsearch.discovery.zen - [Steven Lang] failed to send join  
request to master  
[[es-a-qa-1][230ODTyvQnSQ-ZmdE0Z94A][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}],  
reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting  
for task.]  
22970 [elasticsearch[Steven Lang][generic][T#1]] INFO  
org.elasticsearch.discovery.zen - [Steven Lang] failed to send join  
request to master  
[[es-a-qa-1][230ODTyvQnSQ-ZmdE0Z94A][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}],  
reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting  
for task.]  
28996 [elasticsearch[Steven Lang][generic][T#1]] INFO  
org.elasticsearch.discovery.zen - [Steven Lang] failed to send join  
request to master  
[[es-a-qa-1][230ODTyvQnSQ-ZmdE0Z94A][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}],  
reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting  
for task.]  
34856 [main] WARN org.elasticsearch.discovery - [Steven Lang] waited for  
30s and no initial state was set by the discovery  
34857 [main] INFO org.elasticsearch.discovery - [Steven Lang]  
search\_0.90.5-1\_qa/VcU1VfDoQ6uAkX3ULn7gWw

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2013, 9:19pm UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/5 "2013-10-19T21:19:42Z")

</div>

Sounds like ES is launched on a different network.  
Do you have multiple Network card in your instance?  
If so, could you try to set es to listen on 172.16.51.x ?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 19 oct. 2013 à 21:51, "peter@vagaband.co" [peter@vagaband.co](mailto:peter@vagaband.co) a écrit :

Yeah, using the port did not help. I am able to telnet to these machines to 9300, so it's not a firewall issue.

## 3686 [main] INFO org.elasticsearch.node - [Steven Lang] version[0.90.5], pid[3861], build[c8714e8/2013-09-17T12:50:20Z] 3686 [main] INFO org.elasticsearch.node - [Steven Lang] initializing ... 3691 [main] INFO org.elasticsearch.plugins - [Steven Lang] loaded [], sites [] 4789 [main] INFO org.elasticsearch.node - [Steven Lang] initialized 4789 [main] INFO org.elasticsearch.node - [Steven Lang] starting ... 4852 [main] INFO org.elasticsearch.transport - [Steven Lang] bound\_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish\_address {inet[/10.0.1.9:9300]} 10908 [elasticsearch[Steven Lang][generic][T#1]] INFO org.elasticsearch.discovery.zen - [Steven Lang] failed to send join request to master [[es-a-qa-1][230ODTyvQnSQ-ZmdE0Z94A][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}], reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting for task.] 16936 [elasticsearch[Steven Lang][generic][T#1]] INFO org.elasticsearch.discovery.zen - [Steven Lang] failed to send join request to master [[es-a-qa-1][230ODTyvQnSQ-ZmdE0Z94A][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}], reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting for task.] 22970 [elasticsearch[Steven Lang][generic][T#1]] INFO org.elasticsearch.discovery.zen - [Steven Lang] failed to send join request to master [[es-a-qa-1][230ODTyvQnSQ-ZmdE0Z94A][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}], reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting for task.] 28996 [elasticsearch[Steven Lang][generic][T#1]] INFO org.elasticsearch.discovery.zen - [Steven Lang] failed to send join request to master [[es-a-qa-1][230ODTyvQnSQ-ZmdE0Z94A][inet[/172.16.51.178:9300]]{max\_local\_storage\_nodes=1}], reason [org.elasticsearch.ElasticSearchTimeoutException: Timeout waiting for task.] 34856 [main] WARN org.elasticsearch.discovery - [Steven Lang] waited for 30s and no initial state was set by the discovery 34857 [main] INFO org.elasticsearch.discovery - [Steven Lang] search\_0.90.5-1\_qa/VcU1VfDoQ6uAkX3ULn7gWw

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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [October 19, 2013, 9:32pm UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/6 "2013-10-19T21:32:12Z")

</div>

Also note that telnet is not enough to check firewall issues, you must open  
both UDP and TCP protocols on the hosts/ports. Apparently your host on  
10.0.0.0/8 class A subnet can't reach hosts on 172.16.0.0/16 class B subnet.

Jörg

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![peter2](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@peter2](https://discuss.elastic.co/u/peter2)
#### Post date: [October 19, 2013, 11:16pm UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/7 "2013-10-19T23:16:48Z")

</div>

Yup, that was it. UDP was not allowed on my QA data center. Thanks, David  
and Jörg.

--  
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).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Cheolgoo\_Kang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheolgoo_kang/32/1692_2.png) [@Cheolgoo\_Kang](https://discuss.elastic.co/u/Cheolgoo_Kang)
#### Post date: [March 29, 2014, 4:16am UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/8 "2014-03-29T04:16:12Z")

</div>

It's a bit old issue, but how did you fix it?

On Saturday, October 19, 2013 4:16:48 PM UTC-7, [pe...@vagaband.co](mailto:pe...@vagaband.co) wrote:

> Yup, that was it. UDP was not allowed on my QA data center. Thanks, David  
> and Jörg.

--  
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/ab7d09ae-9068-4469-9a45-5439f930a228%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ab7d09ae-9068-4469-9a45-5439f930a228%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![David\_Chia](https://avatars.discourse-cdn.com/v4/letter/d/b4bc9f/32.png) [@David\_Chia](https://discuss.elastic.co/u/David_Chia)
#### Post date: [May 6, 2014, 4:28pm UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/9 "2014-05-06T16:28:09Z")

</div>

This was a lifesaver. Thanks for pointing out that both UDP and TCP needed  
to be open.

On Saturday, October 19, 2013 2:32:12 PM UTC-7, Jörg Prante wrote:

> Also note that telnet is not enough to check firewall issues, you must  
> open both UDP and TCP protocols on the hosts/ports. Apparently your host on  
> 10.0.0.0/8 class A subnet can't reach hosts on 172.16.0.0/16 class B  
> subnet.
> 
> Jörg

--  
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/195ecbf3-0785-40ac-ace3-c9f98d218fef%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/195ecbf3-0785-40ac-ace3-c9f98d218fef%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, 1:31am UTC](https://discuss.elastic.co/t/node-client-cannot-connect-to-cluster/13770/10 "2017-07-06T01:31:19Z")

</div>


