# How does a Node find the cluster just by the cluster name?

**URL:** <https://discuss.elastic.co/t/how-does-a-node-find-the-cluster-just-by-the-cluster-name/19534>\
**Category:** Elasticsearch\
**Created:** [August 30, 2014, 7:27am UTC](https://discuss.elastic.co/t/how-does-a-node-find-the-cluster-just-by-the-cluster-name/19534 "2014-08-30T07:27:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Albert\_Lim](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Albert\_Lim](https://discuss.elastic.co/u/Albert_Lim)\
**Post date:** [August 30, 2014, 7:27am UTC](https://discuss.elastic.co/t/how-does-a-node-find-the-cluster-just-by-the-cluster-name/19534/1 "2014-08-30T07:27:33Z")

</div>

I'm using the following code to connect to my cluster

Node node = nodeBuilder().clusterName("yourclustername").node();  
Client client = node.client();

How does the nodeBuilder know the IP address of my cluster, just by the  
cluster name?

--  
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/931486c5-e6cb-4485-96e2-7acee388eaf6%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/931486c5-e6cb-4485-96e2-7acee388eaf6%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Albert\_Lim](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Albert\_Lim](https://discuss.elastic.co/u/Albert_Lim)\
**Post date:** [August 30, 2014, 7:29am UTC](https://discuss.elastic.co/t/how-does-a-node-find-the-cluster-just-by-the-cluster-name/19534/2 "2014-08-30T07:29:43Z")

</div>

Actually, is this only if you actually have elasticsearch running locally?

On Saturday, August 30, 2014 12:27:33 AM UTC-7, Albert Lim wrote:

> I'm using the following code to connect to my cluster
> 
> Node node = nodeBuilder().clusterName("yourclustername").node();  
> Client client = node.client();
> 
> How does the nodeBuilder know the IP address of my cluster, just by the  
> cluster name?

--  
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/1b6481ab-40ab-40fc-b23e-8052efb158ba%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1b6481ab-40ab-40fc-b23e-8052efb158ba%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 30, 2014, 7:58am UTC](https://discuss.elastic.co/t/how-does-a-node-find-the-cluster-just-by-the-cluster-name/19534/3 "2014-08-30T07:58:53Z")

</div>

It uses multicast to find other nodes running on your network.

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

> Le 30 août 2014 à 09:29, Albert Lim [albertlim322@gmail.com](mailto:albertlim322@gmail.com) a écrit :
> 
> Actually, is this only if you actually have elasticsearch running locally?
> 
> > On Saturday, August 30, 2014 12:27:33 AM UTC-7, Albert Lim wrote:  
> > I'm using the following code to connect to my cluster
> > 
> > Node node = nodeBuilder().clusterName("yourclustername").node();  
> > Client client = node.client();
> > 
> > How does the nodeBuilder know the IP address of my cluster, just by the cluster name?
> 
> --  
> 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/1b6481ab-40ab-40fc-b23e-8052efb158ba%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1b6481ab-40ab-40fc-b23e-8052efb158ba%40googlegroups.com).  
> 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/67C6E999-8E5A-473E-B83F-13BDE17DC3AC%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/67C6E999-8E5A-473E-B83F-13BDE17DC3AC%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Albert\_Lim](https://avatars.discourse-cdn.com/v4/letter/a/51bf81/32.png) [@Albert\_Lim](https://discuss.elastic.co/u/Albert_Lim)\
**Post date:** [August 30, 2014, 10:39am UTC](https://discuss.elastic.co/t/how-does-a-node-find-the-cluster-just-by-the-cluster-name/19534/4 "2014-08-30T10:39:50Z")

</div>

Thank you, so I guess if I have my cluster running on, for example, ec2, my  
local web server will not be able to find the cluster through multicast.

On Saturday, August 30, 2014 12:59:21 AM UTC-7, David Pilato wrote:

> It uses multicast to find other nodes running on your network.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 30 août 2014 à 09:29, Albert Lim \<[albert...@gmail.com](mailto:albert...@gmail.com) \<javascript:\>\> a  
> écrit :
> 
> Actually, is this only if you actually have elasticsearch running locally?
> 
> On Saturday, August 30, 2014 12:27:33 AM UTC-7, Albert Lim wrote:
> 
> > I'm using the following code to connect to my cluster
> > 
> > Node node = nodeBuilder().clusterName("yourclustername").node();  
> > Client client = node.client();
> > 
> > How does the nodeBuilder know the IP address of my cluster, just by the  
> > cluster name?
> 
> --  
> 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/1b6481ab-40ab-40fc-b23e-8052efb158ba%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1b6481ab-40ab-40fc-b23e-8052efb158ba%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/1b6481ab-40ab-40fc-b23e-8052efb158ba%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/1b6481ab-40ab-40fc-b23e-8052efb158ba%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/a5cc1045-fb92-4da2-8ef1-79e97affe574%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a5cc1045-fb92-4da2-8ef1-79e97affe574%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 30, 2014, 10:57am UTC](https://discuss.elastic.co/t/how-does-a-node-find-the-cluster-just-by-the-cluster-name/19534/5 "2014-08-30T10:57:00Z")

</div>

Yes. You need to use unicast or aws plugin.

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

Le 30 août 2014 à 12:39, Albert Lim [albertlim322@gmail.com](mailto:albertlim322@gmail.com) a écrit :

Thank you, so I guess if I have my cluster running on, for example, ec2, my local web server will not be able to find the cluster through multicast.

> On Saturday, August 30, 2014 12:59:21 AM UTC-7, David Pilato wrote:  
> It uses multicast to find other nodes running on your network.
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> > Le 30 août 2014 à 09:29, Albert Lim [albert...@gmail.com](mailto:albert...@gmail.com) a écrit :
> > 
> > Actually, is this only if you actually have elasticsearch running locally?
> > 
> > > On Saturday, August 30, 2014 12:27:33 AM UTC-7, Albert Lim wrote:  
> > > I'm using the following code to connect to my cluster
> > > 
> > > Node node = nodeBuilder().clusterName("yourclustername").node();  
> > > Client client = node.client();
> > > 
> > > How does the nodeBuilder know the IP address of my cluster, just by the cluster name?
> > 
> > --  
> > 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).  
> > To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/1b6481ab-40ab-40fc-b23e-8052efb158ba%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1b6481ab-40ab-40fc-b23e-8052efb158ba%40googlegroups.com).  
> > 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/a5cc1045-fb92-4da2-8ef1-79e97affe574%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a5cc1045-fb92-4da2-8ef1-79e97affe574%40googlegroups.com).  
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/016CABCD-1BF2-4D94-94BF-11D9C2198F77%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/016CABCD-1BF2-4D94-94BF-11D9C2198F77%40pilato.fr).  
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:05am UTC](https://discuss.elastic.co/t/how-does-a-node-find-the-cluster-just-by-the-cluster-name/19534/6 "2017-07-06T01:05:22Z")

</div>


