# When does client need cluster.name?

**URL:** https://discuss.elastic.co/t/when-does-client-need-cluster-name/114916
**Category:** Elasticsearch
**Created:** [January 10, 2018, 4:27pm UTC](https://discuss.elastic.co/t/when-does-client-need-cluster-name/114916 "2018-01-10T16:27:59Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jacobg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jacobg/32/26427_2.png) [@jacobg](https://discuss.elastic.co/u/jacobg)
#### Post date: [January 10, 2018, 4:27pm UTC](https://discuss.elastic.co/t/when-does-client-need-cluster-name/114916/1 "2018-01-10T16:27:59Z")

</div>

The documentation for transport client says to specify [cluster.name](http://cluster.name) setting, but the rest client does not. When is [cluster.name](http://cluster.name) needed, and what is it used for? Is it for sniffing nodes?

Thanks.

---

<div class="post-metadata">

### Author: ![Fram\_Souza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fram_souza/32/24833_2.png) [@Fram\_Souza](https://discuss.elastic.co/u/Fram_Souza)
#### Post date: [January 10, 2018, 4:36pm UTC](https://discuss.elastic.co/t/when-does-client-need-cluster-name/114916/2 "2018-01-10T16:36:44Z")

</div>

Hi @jacobg

A [cluster.name](http://cluster.name) is the property to set the name of your cluster. Default name of your cluster is elasticsearch. You can change it to any name you want.

If you remove [cluster.name](http://cluster.name) , it won't affect your program. Default name would be taken.

Remember! All nodes need have a same name in the [cluster.name](http://cluster.name), and is not needed REST Client.

---

<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: [January 10, 2018, 4:39pm UTC](https://discuss.elastic.co/t/when-does-client-need-cluster-name/114916/3 "2018-01-10T16:39:00Z")

</div>

The cluster name is not needed by the REST Client.

---

<div class="post-metadata">

### Author: ![jacobg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jacobg/32/26427_2.png) [@jacobg](https://discuss.elastic.co/u/jacobg)
#### Post date: [January 10, 2018, 4:57pm UTC](https://discuss.elastic.co/t/when-does-client-need-cluster-name/114916/4 "2018-01-10T16:57:33Z")

</div>

Thanks for the reply @Fram_Souza and @dadoonet. I understand cluster name's purpose from the node's perspective. My question is from the client's perspective. I'm presuming that a host:port configuration will be for a single cluster. So if it's not needed for REST client, why is needed for Transport client?

---

<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: [January 10, 2018, 5:10pm UTC](https://discuss.elastic.co/t/when-does-client-need-cluster-name/114916/5 "2018-01-10T17:10:50Z")

</div>

It was not mandatory for transport client either as you could skip it with the ignore cluster name setting.

But if the later is not set, then the transport client is only connecting to clusters matching the same cluster name.

---

<div class="post-metadata">

### Author: ![jacobg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jacobg/32/26427_2.png) [@jacobg](https://discuss.elastic.co/u/jacobg)
#### Post date: [January 10, 2018, 5:20pm UTC](https://discuss.elastic.co/t/when-does-client-need-cluster-name/114916/6 "2018-01-10T17:20:59Z")

</div>

Ok I see. Thanks @dadoonet!

---

<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: [February 7, 2018, 5:21pm UTC](https://discuss.elastic.co/t/when-does-client-need-cluster-name/114916/7 "2018-02-07T17:21:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
