When does client need cluster.name?

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

Thanks.

Hi @jacobg

A 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 , it won't affect your program. Default name would be taken.

Remember! All nodes need have a same name in the cluster.name, and is not needed REST Client.

The cluster name is not needed by the REST Client.

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?

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.

Ok I see. Thanks @dadoonet!

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