# Is there a way to use TransportClient that will use all available servers in the cluster without specifically specifying them?

**URL:** <https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521>\
**Category:** Elasticsearch\
**Created:** [January 28, 2013, 10:11am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521 "2013-01-28T10:11:53Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ron\_Sher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_sher/32/4472_2.png) [@Ron\_Sher](https://discuss.elastic.co/u/Ron_Sher)\
**Post date:** [January 28, 2013, 10:11am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/1 "2013-01-28T10:11:53Z")

</div>

Hi,

I have several environments (test & production) that have elasticsearch  
clusters.  
I would like to use the TransportClient and give it the cluster name and  
have it figure out automatically which servers exist in each cluster.

When I don't supply the servers explicitly (by using addTransportAddress) I  
get an exception:

org.elasticsearch.client.transport.NoNodeAvailableException: No node available

Tried setting .put("discovery.enabled", true), but that didn't seem to help.

Is there a way to do that?

I don't want to use the node client since I have many clients (this is part of a mapreduce job)

Thanks for you help,

Ron

--

---

<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 28, 2013, 11:25am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/2 "2013-01-28T11:25:27Z")

</div>

You have to know at least one address when using transport client.

What you are probably after, is to get a Client from a client only node.  
Just start a client only node. It will be part of the cluster but won't hold data.  
Then ask for a Client from that node.

## HTH

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

Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :

> Hi,
> 
> I have several environments (test & production) that have elasticsearch clusters.  
> I would like to use the TransportClient and give it the cluster name and have it figure out automatically which servers exist in each cluster.
> 
> When I don't supply the servers explicitly (by using addTransportAddress) I get an exception:  
> org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> 
> Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> 
> Is there a way to do that?  
> I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> 
> ## Thanks for you help, Ron

--

---

<div class="post-metadata">

**Author:** ![Ron\_Sher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_sher/32/4472_2.png) [@Ron\_Sher](https://discuss.elastic.co/u/Ron_Sher)\
**Post date:** [January 28, 2013, 2:58pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/3 "2013-01-28T14:58:39Z")

</div>

Thanks for the quick reply.

What happens when I supply only 1 address? Will the client automatically  
use other servers in the cluster also?  
What's the meaning of the "client.transport.sniff"?  
Will it only find out other servers if I set this to true?

Thanks again,  
Ron

On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> You have to know at least one address when using transport client.
> 
> What you are probably after, is to get a Client from a client only node.  
> Just start a client only node. It will be part of the cluster but won't  
> hold data.  
> Then ask for a Client from that node.
> 
> ## HTH
> 
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> Hi,
> 
> I have several environments (test & production) that have elasticsearch  
> clusters.  
> I would like to use the TransportClient and give it the cluster name and  
> have it figure out automatically which servers exist in each cluster.
> 
> When I don't supply the servers explicitly (by using addTransportAddress)  
> I get an exception:
> 
> org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> 
> Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> 
> Is there a way to do that?
> 
> I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> 
> Thanks for you help,
> 
> Ron
> 
> --

--

---

<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 28, 2013, 3:05pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/4 "2013-01-28T15:05:20Z")

</div>

Yes. Set it to true and it will detect and use other nodes as well.  
That said, I recommend to start with at least two nodes defined in the TransportClient.

David.

Le 28 janv. 2013 à 15:58, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :

> Thanks for the quick reply.
> 
> What happens when I supply only 1 address? Will the client automatically use other servers in the cluster also?  
> What's the meaning of the "client.transport.sniff"?  
> Will it only find out other servers if I set this to true?
> 
> Thanks again,  
> Ron
> 
> On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:  
> You have to know at least one address when using transport client.
> 
> What you are probably after, is to get a Client from a client only node.  
> Just start a client only node. It will be part of the cluster but won't hold data.  
> Then ask for a Client from that node.
> 
> ## HTH
> 
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> > Hi,
> > 
> > I have several environments (test & production) that have elasticsearch clusters.  
> > I would like to use the TransportClient and give it the cluster name and have it figure out automatically which servers exist in each cluster.
> > 
> > When I don't supply the servers explicitly (by using addTransportAddress) I get an exception:  
> > org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> > 
> > Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> > 
> > Is there a way to do that?  
> > I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> > 
> > Thanks for you help,  
> > Ron
> > 
> > --
> 
> --

---

<div class="post-metadata">

**Author:** ![Ron\_Sher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_sher/32/4472_2.png) [@Ron\_Sher](https://discuss.elastic.co/u/Ron_Sher)\
**Post date:** [January 28, 2013, 3:40pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/5 "2013-01-28T15:40:17Z")

</div>

Thanks again for your quick reply.

Could you please elaborate a bit? Why would you recommend using more nodes  
if they are automatically discovered?  
What should be the consideration to use, or not to use, sniffing?

Thanks,  
Ron

On Mon, Jan 28, 2013 at 5:05 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Yes. Set it to true and it will detect and use other nodes as well.  
> That said, I recommend to start with at least two nodes defined in the  
> TransportClient.
> 
> David.
> 
> Le 28 janv. 2013 à 15:58, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> Thanks for the quick reply.
> 
> What happens when I supply only 1 address? Will the client automatically  
> use other servers in the cluster also?  
> What's the meaning of the "client.transport.sniff"?  
> Will it only find out other servers if I set this to true?
> 
> Thanks again,  
> Ron
> 
> On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > You have to know at least one address when using transport client.
> > 
> > What you are probably after, is to get a Client from a client only node.  
> > Just start a client only node. It will be part of the cluster but won't  
> > hold data.  
> > Then ask for a Client from that node.
> > 
> > ## HTH
> > 
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > 
> > Hi,
> > 
> > I have several environments (test & production) that have elasticsearch  
> > clusters.  
> > I would like to use the TransportClient and give it the cluster name and  
> > have it figure out automatically which servers exist in each cluster.
> > 
> > When I don't supply the servers explicitly (by using addTransportAddress)  
> > I get an exception:
> > 
> > org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> > 
> > Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> > 
> > Is there a way to do that?
> > 
> > I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> > 
> > Thanks for you help,
> > 
> > Ron
> > 
> > --
> 
> --

--

---

<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 28, 2013, 7:35pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/6 "2013-01-28T19:35:28Z")

</div>

Imagine you have a webapp with a transport client to your cluster of 20 nodes.

You shutdown the web app for maintenance and restart it.

But, in your cluster, your node 1 is not working.

When you restart your webapp, it will try to connect to node1 but will fail. Your webapp does not know other nodes yet as you did not give another node address.

So you have a cluster with 19 nodes working but you won't be able to provide search for your users.

Make sense?

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

Le 28 janv. 2013 à 16:40, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :

Thanks again for your quick reply.

Could you please elaborate a bit? Why would you recommend using more nodes if they are automatically discovered?  
What should be the consideration to use, or not to use, sniffing?

Thanks,  
Ron

On Mon, Jan 28, 2013 at 5:05 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Yes. Set it to true and it will detect and use other nodes as well.  
> That said, I recommend to start with at least two nodes defined in the TransportClient.
> 
> David.
> 
> Le 28 janv. 2013 à 15:58, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> > Thanks for the quick reply.
> > 
> > What happens when I supply only 1 address? Will the client automatically use other servers in the cluster also?  
> > What's the meaning of the "client.transport.sniff"?  
> > Will it only find out other servers if I set this to true?
> > 
> > Thanks again,  
> > Ron
> > 
> > On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > You have to know at least one address when using transport client.
> > > 
> > > What you are probably after, is to get a Client from a client only node.  
> > > Just start a client only node. It will be part of the cluster but won't hold data.  
> > > Then ask for a Client from that node.
> > > 
> > > ## HTH
> > > 
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > 
> > > > Hi,
> > > > 
> > > > I have several environments (test & production) that have elasticsearch clusters.  
> > > > I would like to use the TransportClient and give it the cluster name and have it figure out automatically which servers exist in each cluster.
> > > > 
> > > > When I don't supply the servers explicitly (by using addTransportAddress) I get an exception:  
> > > > org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> > > > 
> > > > Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> > > > 
> > > > Is there a way to do that?  
> > > > I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> > > > 
> > > > Thanks for you help,  
> > > > Ron
> > > > 
> > > > --
> > 
> > --

--

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group, send 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:** ![Ron\_Sher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_sher/32/4472_2.png) [@Ron\_Sher](https://discuss.elastic.co/u/Ron_Sher)\
**Post date:** [January 29, 2013, 8:16am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/7 "2013-01-29T08:16:44Z")

</div>

yes, but that could be true for any combination of 2 servers I choose.  
Isn't there any way to make the client automatically discover other servers?

What exactly does the sniff option do?

Thanks again for your help,  
Ron

On Mon, Jan 28, 2013 at 9:35 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Imagine you have a webapp with a transport client to your cluster of 20  
> nodes.
> 
> You shutdown the web app for maintenance and restart it.
> 
> But, in your cluster, your node 1 is not working.
> 
> When you restart your webapp, it will try to connect to node1 but will  
> fail. Your webapp does not know other nodes yet as you did not give another  
> node address.
> 
> So you have a cluster with 19 nodes working but you won't be able to  
> provide search for your users.
> 
> Make sense?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 28 janv. 2013 à 16:40, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> Thanks again for your quick reply.
> 
> Could you please elaborate a bit? Why would you recommend using more nodes  
> if they are automatically discovered?  
> What should be the consideration to use, or not to use, sniffing?
> 
> Thanks,  
> Ron
> 
> On Mon, Jan 28, 2013 at 5:05 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > Yes. Set it to true and it will detect and use other nodes as well.  
> > That said, I recommend to start with at least two nodes defined in the  
> > TransportClient.
> > 
> > David.
> > 
> > Le 28 janv. 2013 à 15:58, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > 
> > Thanks for the quick reply.
> > 
> > What happens when I supply only 1 address? Will the client automatically  
> > use other servers in the cluster also?  
> > What's the meaning of the "client.transport.sniff"?  
> > Will it only find out other servers if I set this to true?
> > 
> > Thanks again,  
> > Ron
> > 
> > On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > You have to know at least one address when using transport client.
> > > 
> > > What you are probably after, is to get a Client from a client only node.  
> > > Just start a client only node. It will be part of the cluster but won't  
> > > hold data.  
> > > Then ask for a Client from that node.
> > > 
> > > ## HTH
> > > 
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > 
> > > Hi,
> > > 
> > > I have several environments (test & production) that have elasticsearch  
> > > clusters.  
> > > I would like to use the TransportClient and give it the cluster name and  
> > > have it figure out automatically which servers exist in each cluster.
> > > 
> > > When I don't supply the servers explicitly (by using  
> > > addTransportAddress) I get an exception:
> > > 
> > > org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> > > 
> > > Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> > > 
> > > Is there a way to do that?
> > > 
> > > I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> > > 
> > > Thanks for you help,
> > > 
> > > Ron
> > > 
> > > --
> > 
> > --
> 
> --
> 
> --  
> 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:** ![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 29, 2013, 8:24am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/8 "2013-01-29T08:24:29Z")

</div>

Yes. So the more nodes your transport client is aware of, the more chance you will have to be able to start your app.  
Sniff option let the user decide if your app will only work with given addresses (default to false) or if once started, the TransportClient will ask to the master node information about other nodes and will connect then to them.

If you need auto discovering without giving nodes address, only using the cluster name, you have to use a NodeClient.

Documentation here explain that: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html)

Does it help?

Le 29 janv. 2013 à 09:16, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :

> yes, but that could be true for any combination of 2 servers I choose.  
> Isn't there any way to make the client automatically discover other servers?
> 
> What exactly does the sniff option do?
> 
> Thanks again for your help,  
> Ron
> 
> On Mon, Jan 28, 2013 at 9:35 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:  
> Imagine you have a webapp with a transport client to your cluster of 20 nodes.
> 
> You shutdown the web app for maintenance and restart it.
> 
> But, in your cluster, your node 1 is not working.
> 
> When you restart your webapp, it will try to connect to node1 but will fail. Your webapp does not know other nodes yet as you did not give another node address.
> 
> So you have a cluster with 19 nodes working but you won't be able to provide search for your users.
> 
> Make sense?
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 28 janv. 2013 à 16:40, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> Thanks again for your quick reply.
> 
> Could you please elaborate a bit? Why would you recommend using more nodes if they are automatically discovered?  
> What should be the consideration to use, or not to use, sniffing?
> 
> Thanks,  
> Ron
> 
> On Mon, Jan 28, 2013 at 5:05 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:  
> Yes. Set it to true and it will detect and use other nodes as well.  
> That said, I recommend to start with at least two nodes defined in the TransportClient.
> 
> David.
> 
> Le 28 janv. 2013 à 15:58, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> > Thanks for the quick reply.
> > 
> > What happens when I supply only 1 address? Will the client automatically use other servers in the cluster also?  
> > What's the meaning of the "client.transport.sniff"?  
> > Will it only find out other servers if I set this to true?
> > 
> > Thanks again,  
> > Ron
> > 
> > On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:  
> > You have to know at least one address when using transport client.
> > 
> > What you are probably after, is to get a Client from a client only node.  
> > Just start a client only node. It will be part of the cluster but won't hold data.  
> > Then ask for a Client from that node.
> > 
> > ## HTH
> > 
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > 
> > > Hi,
> > > 
> > > I have several environments (test & production) that have elasticsearch clusters.  
> > > I would like to use the TransportClient and give it the cluster name and have it figure out automatically which servers exist in each cluster.
> > > 
> > > When I don't supply the servers explicitly (by using addTransportAddress) I get an exception:  
> > > org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> > > 
> > > Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> > > 
> > > Is there a way to do that?  
> > > I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> > > 
> > > Thanks for you help,  
> > > Ron
> > > 
> > > --
> > 
> > --
> 
> --
> 
> --  
> 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).

--  
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:** ![Ron\_Sher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_sher/32/4472_2.png) [@Ron\_Sher](https://discuss.elastic.co/u/Ron_Sher)\
**Post date:** [January 29, 2013, 8:53am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/9 "2013-01-29T08:53:43Z")

</div>

The document isn't clear enough for me (you explain it much better, thanks  
🙂 )

If I don't specify the sniff option, will it automatically get information  
on all nodes and be able to use nodes that I don't explicitly specify?  
Do I need to do .put("client.transport.sniff", true) for the client to use  
other nodes I didn't specify?

Thanks again,  
Ron

On Tue, Jan 29, 2013 at 10:24 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Yes. So the more nodes your transport client is aware of, the more chance  
> you will have to be able to start your app.  
> Sniff option let the user decide if your app will only work with given  
> addresses (default to false) or if once started, the TransportClient will  
> ask to the master node information about other nodes and will connect then  
> to them.
> 
> If you need auto discovering without giving nodes address, only using the  
> cluster name, you have to use a NodeClient.
> 
> Documentation here explain that:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html)
> 
> Does it help?
> 
> Le 29 janv. 2013 à 09:16, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> yes, but that could be true for any combination of 2 servers I choose.  
> Isn't there any way to make the client automatically discover other  
> servers?
> 
> What exactly does the sniff option do?
> 
> Thanks again for your help,  
> Ron
> 
> On Mon, Jan 28, 2013 at 9:35 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > Imagine you have a webapp with a transport client to your cluster of 20  
> > nodes.
> > 
> > You shutdown the web app for maintenance and restart it.
> > 
> > But, in your cluster, your node 1 is not working.
> > 
> > When you restart your webapp, it will try to connect to node1 but will  
> > fail. Your webapp does not know other nodes yet as you did not give another  
> > node address.
> > 
> > So you have a cluster with 19 nodes working but you won't be able to  
> > provide search for your users.
> > 
> > Make sense?
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 28 janv. 2013 à 16:40, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > 
> > Thanks again for your quick reply.
> > 
> > Could you please elaborate a bit? Why would you recommend using more  
> > nodes if they are automatically discovered?  
> > What should be the consideration to use, or not to use, sniffing?
> > 
> > Thanks,  
> > Ron
> > 
> > On Mon, Jan 28, 2013 at 5:05 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > Yes. Set it to true and it will detect and use other nodes as well.  
> > > That said, I recommend to start with at least two nodes defined in the  
> > > TransportClient.
> > > 
> > > David.
> > > 
> > > Le 28 janv. 2013 à 15:58, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > 
> > > Thanks for the quick reply.
> > > 
> > > What happens when I supply only 1 address? Will the client automatically  
> > > use other servers in the cluster also?  
> > > What's the meaning of the "client.transport.sniff"?  
> > > Will it only find out other servers if I set this to true?
> > > 
> > > Thanks again,  
> > > Ron
> > > 
> > > On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > 
> > > > You have to know at least one address when using transport client.
> > > > 
> > > > What you are probably after, is to get a Client from a client only node.  
> > > > Just start a client only node. It will be part of the cluster but won't  
> > > > hold data.  
> > > > Then ask for a Client from that node.
> > > > 
> > > > ## HTH
> > > > 
> > > > David 😉  
> > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > 
> > > > Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > > 
> > > > Hi,
> > > > 
> > > > I have several environments (test & production) that have elasticsearch  
> > > > clusters.  
> > > > I would like to use the TransportClient and give it the cluster name  
> > > > and have it figure out automatically which servers exist in each cluster.
> > > > 
> > > > When I don't supply the servers explicitly (by using  
> > > > addTransportAddress) I get an exception:
> > > > 
> > > > org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> > > > 
> > > > Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> > > > 
> > > > Is there a way to do that?
> > > > 
> > > > I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> > > > 
> > > > Thanks for you help,
> > > > 
> > > > Ron
> > > > 
> > > > --
> > > 
> > > --
> > 
> > --
> > 
> > --  
> > 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).
> 
> --  
> 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:** ![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 29, 2013, 8:56am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/10 "2013-01-29T08:56:28Z")

</div>

You have to specify .put("client.transport.sniff", true) if you want that your embedded TransportClient connect also to other nodes you did not specify.

Le 29 janv. 2013 à 09:53, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :

> The document isn't clear enough for me (you explain it much better, thanks 🙂 )
> 
> If I don't specify the sniff option, will it automatically get information on all nodes and be able to use nodes that I don't explicitly specify?  
> Do I need to do .put("client.transport.sniff", true) for the client to use other nodes I didn't specify?
> 
> Thanks again,  
> Ron
> 
> On Tue, Jan 29, 2013 at 10:24 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:  
> Yes. So the more nodes your transport client is aware of, the more chance you will have to be able to start your app.  
> Sniff option let the user decide if your app will only work with given addresses (default to false) or if once started, the TransportClient will ask to the master node information about other nodes and will connect then to them.
> 
> If you need auto discovering without giving nodes address, only using the cluster name, you have to use a NodeClient.
> 
> Documentation here explain that: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html)
> 
> Does it help?
> 
> Le 29 janv. 2013 à 09:16, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> > yes, but that could be true for any combination of 2 servers I choose.  
> > Isn't there any way to make the client automatically discover other servers?
> > 
> > What exactly does the sniff option do?
> > 
> > Thanks again for your help,  
> > Ron
> > 
> > On Mon, Jan 28, 2013 at 9:35 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:  
> > Imagine you have a webapp with a transport client to your cluster of 20 nodes.
> > 
> > You shutdown the web app for maintenance and restart it.
> > 
> > But, in your cluster, your node 1 is not working.
> > 
> > When you restart your webapp, it will try to connect to node1 but will fail. Your webapp does not know other nodes yet as you did not give another node address.
> > 
> > So you have a cluster with 19 nodes working but you won't be able to provide search for your users.
> > 
> > Make sense?
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 28 janv. 2013 à 16:40, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > 
> > Thanks again for your quick reply.
> > 
> > Could you please elaborate a bit? Why would you recommend using more nodes if they are automatically discovered?  
> > What should be the consideration to use, or not to use, sniffing?
> > 
> > Thanks,  
> > Ron
> > 
> > On Mon, Jan 28, 2013 at 5:05 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:  
> > Yes. Set it to true and it will detect and use other nodes as well.  
> > That said, I recommend to start with at least two nodes defined in the TransportClient.
> > 
> > David.
> > 
> > Le 28 janv. 2013 à 15:58, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > 
> > > Thanks for the quick reply.
> > > 
> > > What happens when I supply only 1 address? Will the client automatically use other servers in the cluster also?  
> > > What's the meaning of the "client.transport.sniff"?  
> > > Will it only find out other servers if I set this to true?
> > > 
> > > Thanks again,  
> > > Ron
> > > 
> > > On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:  
> > > You have to know at least one address when using transport client.
> > > 
> > > What you are probably after, is to get a Client from a client only node.  
> > > Just start a client only node. It will be part of the cluster but won't hold data.  
> > > Then ask for a Client from that node.
> > > 
> > > ## HTH
> > > 
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > 
> > > > Hi,
> > > > 
> > > > I have several environments (test & production) that have elasticsearch clusters.  
> > > > I would like to use the TransportClient and give it the cluster name and have it figure out automatically which servers exist in each cluster.
> > > > 
> > > > When I don't supply the servers explicitly (by using addTransportAddress) I get an exception:  
> > > > org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> > > > 
> > > > Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> > > > 
> > > > Is there a way to do that?  
> > > > I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> > > > 
> > > > Thanks for you help,  
> > > > Ron
> > > > 
> > > > --
> > > 
> > > --
> > 
> > --
> > 
> > --  
> > 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).
> 
> --  
> 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).

--  
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:** ![Ron\_Sher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_sher/32/4472_2.png) [@Ron\_Sher](https://discuss.elastic.co/u/Ron_Sher)\
**Post date:** [January 30, 2013, 6:49am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/11 "2013-01-30T06:49:02Z")

</div>

Are there any implications (like performance hit or others) that I should  
consider to not use sniff?  
I wandering why this is not the default behavior

Thanks,  
Ron

On Tue, Jan 29, 2013 at 10:56 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> You have to specify .put("client.transport.sniff", true) if you want that  
> your embedded TransportClient connect also to other nodes you did not  
> specify.
> 
> Le 29 janv. 2013 à 09:53, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> The document isn't clear enough for me (you explain it much better, thanks  
> 🙂 )
> 
> If I don't specify the sniff option, will it automatically get information  
> on all nodes and be able to use nodes that I don't explicitly specify?  
> Do I need to do .put("client.transport.sniff", true) for the client to  
> use other nodes I didn't specify?
> 
> Thanks again,  
> Ron
> 
> On Tue, Jan 29, 2013 at 10:24 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > Yes. So the more nodes your transport client is aware of, the more chance  
> > you will have to be able to start your app.  
> > Sniff option let the user decide if your app will only work with given  
> > addresses (default to false) or if once started, the TransportClient will  
> > ask to the master node information about other nodes and will connect then  
> > to them.
> > 
> > If you need auto discovering without giving nodes address, only using the  
> > cluster name, you have to use a NodeClient.
> > 
> > Documentation here explain that:  
> > [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html)
> > 
> > Does it help?
> > 
> > Le 29 janv. 2013 à 09:16, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > 
> > yes, but that could be true for any combination of 2 servers I choose.  
> > Isn't there any way to make the client automatically discover other  
> > servers?
> > 
> > What exactly does the sniff option do?
> > 
> > Thanks again for your help,  
> > Ron
> > 
> > On Mon, Jan 28, 2013 at 9:35 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > Imagine you have a webapp with a transport client to your cluster of 20  
> > > nodes.
> > > 
> > > You shutdown the web app for maintenance and restart it.
> > > 
> > > But, in your cluster, your node 1 is not working.
> > > 
> > > When you restart your webapp, it will try to connect to node1 but will  
> > > fail. Your webapp does not know other nodes yet as you did not give another  
> > > node address.
> > > 
> > > So you have a cluster with 19 nodes working but you won't be able to  
> > > provide search for your users.
> > > 
> > > Make sense?
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 28 janv. 2013 à 16:40, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > 
> > > Thanks again for your quick reply.
> > > 
> > > Could you please elaborate a bit? Why would you recommend using more  
> > > nodes if they are automatically discovered?  
> > > What should be the consideration to use, or not to use, sniffing?
> > > 
> > > Thanks,  
> > > Ron
> > > 
> > > On Mon, Jan 28, 2013 at 5:05 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > 
> > > > Yes. Set it to true and it will detect and use other nodes as well.  
> > > > That said, I recommend to start with at least two nodes defined in the  
> > > > TransportClient.
> > > > 
> > > > David.
> > > > 
> > > > Le 28 janv. 2013 à 15:58, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > > 
> > > > Thanks for the quick reply.
> > > > 
> > > > What happens when I supply only 1 address? Will the client  
> > > > automatically use other servers in the cluster also?  
> > > > What's the meaning of the "client.transport.sniff"?  
> > > > Will it only find out other servers if I set this to true?
> > > > 
> > > > Thanks again,  
> > > > Ron
> > > > 
> > > > On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > > 
> > > > > You have to know at least one address when using transport client.
> > > > > 
> > > > > What you are probably after, is to get a Client from a client only  
> > > > > node.  
> > > > > Just start a client only node. It will be part of the cluster but  
> > > > > won't hold data.  
> > > > > Then ask for a Client from that node.
> > > > > 
> > > > > ## HTH
> > > > > 
> > > > > David 😉  
> > > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > > 
> > > > > Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > > > 
> > > > > Hi,
> > > > > 
> > > > > I have several environments (test & production) that have  
> > > > > elasticsearch clusters.  
> > > > > I would like to use the TransportClient and give it the cluster name  
> > > > > and have it figure out automatically which servers exist in each cluster.
> > > > > 
> > > > > When I don't supply the servers explicitly (by using  
> > > > > addTransportAddress) I get an exception:
> > > > > 
> > > > > org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> > > > > 
> > > > > Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> > > > > 
> > > > > Is there a way to do that?
> > > > > 
> > > > > I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> > > > > 
> > > > > Thanks for you help,
> > > > > 
> > > > > Ron
> > > > > 
> > > > > --
> > > > 
> > > > --
> > > 
> > > --
> > > 
> > > --  
> > > 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).
> > 
> > --  
> > 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).
> 
> --  
> 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:** ![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 30, 2013, 7:32am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/12 "2013-01-30T07:32:53Z")

</div>

No. I don't see any bad side effect.

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

Le 30 janv. 2013 à 07:49, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :

Are there any implications (like performance hit or others) that I should consider to not use sniff?  
I wandering why this is not the default behavior

Thanks,  
Ron

On Tue, Jan 29, 2013 at 10:56 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> You have to specify .put("client.transport.sniff", true) if you want that your embedded TransportClient connect also to other nodes you did not specify.
> 
> Le 29 janv. 2013 à 09:53, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> 
> > The document isn't clear enough for me (you explain it much better, thanks 🙂 )
> > 
> > If I don't specify the sniff option, will it automatically get information on all nodes and be able to use nodes that I don't explicitly specify?  
> > Do I need to do .put("client.transport.sniff", true) for the client to use other nodes I didn't specify?
> > 
> > Thanks again,  
> > Ron
> > 
> > On Tue, Jan 29, 2013 at 10:24 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > Yes. So the more nodes your transport client is aware of, the more chance you will have to be able to start your app.  
> > > Sniff option let the user decide if your app will only work with given addresses (default to false) or if once started, the TransportClient will ask to the master node information about other nodes and will connect then to them.
> > > 
> > > If you need auto discovering without giving nodes address, only using the cluster name, you have to use a NodeClient.
> > > 
> > > Documentation here explain that: [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/java-api/client.html)
> > > 
> > > Does it help?
> > > 
> > > Le 29 janv. 2013 à 09:16, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > 
> > > > yes, but that could be true for any combination of 2 servers I choose.  
> > > > Isn't there any way to make the client automatically discover other servers?
> > > > 
> > > > What exactly does the sniff option do?
> > > > 
> > > > Thanks again for your help,  
> > > > Ron
> > > > 
> > > > On Mon, Jan 28, 2013 at 9:35 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > > 
> > > > > Imagine you have a webapp with a transport client to your cluster of 20 nodes.
> > > > > 
> > > > > You shutdown the web app for maintenance and restart it.
> > > > > 
> > > > > But, in your cluster, your node 1 is not working.
> > > > > 
> > > > > When you restart your webapp, it will try to connect to node1 but will fail. Your webapp does not know other nodes yet as you did not give another node address.
> > > > > 
> > > > > So you have a cluster with 19 nodes working but you won't be able to provide search for your users.
> > > > > 
> > > > > Make sense?
> > > > > 
> > > > > --  
> > > > > David 😉  
> > > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > > 
> > > > > Le 28 janv. 2013 à 16:40, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > > > 
> > > > > Thanks again for your quick reply.
> > > > > 
> > > > > Could you please elaborate a bit? Why would you recommend using more nodes if they are automatically discovered?  
> > > > > What should be the consideration to use, or not to use, sniffing?
> > > > > 
> > > > > Thanks,  
> > > > > Ron
> > > > > 
> > > > > On Mon, Jan 28, 2013 at 5:05 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > > > 
> > > > > > Yes. Set it to true and it will detect and use other nodes as well.  
> > > > > > That said, I recommend to start with at least two nodes defined in the TransportClient.
> > > > > > 
> > > > > > David.
> > > > > > 
> > > > > > Le 28 janv. 2013 à 15:58, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > > > > 
> > > > > > > Thanks for the quick reply.
> > > > > > > 
> > > > > > > What happens when I supply only 1 address? Will the client automatically use other servers in the cluster also?  
> > > > > > > What's the meaning of the "client.transport.sniff"?  
> > > > > > > Will it only find out other servers if I set this to true?
> > > > > > > 
> > > > > > > Thanks again,  
> > > > > > > Ron
> > > > > > > 
> > > > > > > On Mon, Jan 28, 2013 at 1:25 PM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > > > > > > 
> > > > > > > > You have to know at least one address when using transport client.
> > > > > > > > 
> > > > > > > > What you are probably after, is to get a Client from a client only node.  
> > > > > > > > Just start a client only node. It will be part of the cluster but won't hold data.  
> > > > > > > > Then ask for a Client from that node.
> > > > > > > > 
> > > > > > > > ## HTH
> > > > > > > > 
> > > > > > > > David 😉  
> > > > > > > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > > > > > > 
> > > > > > > > Le 28 janv. 2013 à 11:11, Ron Sher [ron.sher@gmail.com](mailto:ron.sher@gmail.com) a écrit :
> > > > > > > > 
> > > > > > > > > Hi,
> > > > > > > > > 
> > > > > > > > > I have several environments (test & production) that have elasticsearch clusters.  
> > > > > > > > > I would like to use the TransportClient and give it the cluster name and have it figure out automatically which servers exist in each cluster.
> > > > > > > > > 
> > > > > > > > > When I don't supply the servers explicitly (by using addTransportAddress) I get an exception:  
> > > > > > > > > org.elasticsearch.client.transport.NoNodeAvailableException: No node available
> > > > > > > > > 
> > > > > > > > > Tried setting .put("discovery.enabled", true), but that didn't seem to help.
> > > > > > > > > 
> > > > > > > > > Is there a way to do that?  
> > > > > > > > > I don't want to use the node client since I have many clients (this is part of a mapreduce job)
> > > > > > > > > 
> > > > > > > > > Thanks for you help,  
> > > > > > > > > Ron
> > > > > > > > > 
> > > > > > > > > --
> > > > > > > 
> > > > > > > --
> > > > > 
> > > > > --
> > > > > 
> > > > > --  
> > > > > 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).
> > > 
> > > --  
> > > 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).
> 
> --  
> 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).

--  
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:** [January 30, 2013, 9:14am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/13 "2013-01-30T09:14:34Z")

</div>

If you disable "sniffing", you can't have failover (in case the node the  
transport client is connected to leaves the cluster for example). So  
"sniffing" is better OOTB experience - it works more reliable.

Jörg

Am 30.01.13 07:49, schrieb Ron Sher:

> Are there any implications (like performance hit or others) that I  
> should consider to not use sniff?  
> I wandering why this is not the default behavior

--  
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:** ![Ron\_Sher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ron_sher/32/4472_2.png) [@Ron\_Sher](https://discuss.elastic.co/u/Ron_Sher)\
**Post date:** [January 30, 2013, 3:16pm UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/14 "2013-01-30T15:16:58Z")

</div>

I think I'm missing something. Sniffing isn't enabled oob. I need to enable  
it  
בתאריך 30 בינו 2013 11:14, מאת "Jörg Prante" [joergprante@gmail.com](mailto:joergprante@gmail.com):

> If you disable "sniffing", you can't have failover (in case the node the  
> transport client is connected to leaves the cluster for example). So  
> "sniffing" is better OOTB experience - it works more reliable.
> 
> Jörg
> 
> Am 30.01.13 07:49, schrieb Ron Sher:
> 
> > Are there any implications (like performance hit or others) that I should  
> > consider to not use sniff?  
> > I wandering why this is not the default behavior
> 
> --  
> 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](http://googlegroups.com)[elasticsearch%2Bunsubscribe@googlegroups.com](mailto:elasticsearch%2Bunsubscribe@googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/\*\*groups/opt\_out](https://groups.google.com/**groups/opt_out)[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:** ![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, 2:53am UTC](https://discuss.elastic.co/t/is-there-a-way-to-use-transportclient-that-will-use-all-available-servers-in-the-cluster-without-specifically-specifying-them/10521/15 "2017-07-06T02:53:55Z")

</div>


