# Java transport client, which hosts to add?

**URL:** <https://discuss.elastic.co/t/java-transport-client-which-hosts-to-add/18981>\
**Category:** Elasticsearch\
**Created:** [July 30, 2014, 3:36pm UTC](https://discuss.elastic.co/t/java-transport-client-which-hosts-to-add/18981 "2014-07-30T15:36:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Gaydenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_gaydenko/32/914_2.png) [@Andrew\_Gaydenko](https://discuss.elastic.co/u/Andrew_Gaydenko)\
**Post date:** [July 30, 2014, 3:36pm UTC](https://discuss.elastic.co/t/java-transport-client-which-hosts-to-add/18981/1 "2014-07-30T15:36:53Z")

</div>

The client has addTransportAddress(). So, I can add all cluster nodes. Is  
it intended way? Or - what are those considerations must be taken into  
account while adding hosts?

--  
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/13d2a061-5418-40bd-9233-72c432aa7643%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/13d2a061-5418-40bd-9233-72c432aa7643%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [July 30, 2014, 4:13pm UTC](https://discuss.elastic.co/t/java-transport-client-which-hosts-to-add/18981/2 "2014-07-30T16:13:16Z")

</div>

You should as many nodes as possible. If you enable client.transport.sniff,  
then the transport client will ask the nodes it does connect to about the  
other nodes in the cluster, which means you can potentially only need to  
specific a single node (not ideal in case that node is down).

--  
Ivan

On Wed, Jul 30, 2014 at 8:36 AM, Andrew Gaydenko [andrew.gaydenko@gmail.com](mailto:andrew.gaydenko@gmail.com)  
wrote:

> The client has addTransportAddress(). So, I can add all cluster nodes. Is  
> it intended way? Or - what are those considerations must be taken into  
> account while adding hosts?
> 
> --  
> 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/13d2a061-5418-40bd-9233-72c432aa7643%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/13d2a061-5418-40bd-9233-72c432aa7643%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/13d2a061-5418-40bd-9233-72c432aa7643%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/13d2a061-5418-40bd-9233-72c432aa7643%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/CALY%3DcQC7i\_wT\_r8kiXYSSee92S%3DJUtp3uROZ1wgO8znQ26c7Uw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQC7i_wT_r8kiXYSSee92S%3DJUtp3uROZ1wgO8znQ26c7Uw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Andrew\_Gaydenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_gaydenko/32/914_2.png) [@Andrew\_Gaydenko](https://discuss.elastic.co/u/Andrew_Gaydenko)\
**Post date:** [July 30, 2014, 4:25pm UTC](https://discuss.elastic.co/t/java-transport-client-which-hosts-to-add/18981/3 "2014-07-30T16:25:36Z")

</div>

On Wednesday, July 30, 2014 8:13:28 PM UTC+4, Ivan Brusic wrote:

> You should as many nodes as possible. If you  
> enable client.transport.sniff, then the transport client will ask the nodes  
> it does connect to about the other nodes in the cluster, which means you  
> can potentially only need to specific a single node (not ideal in case that  
> node is down).

Ivan, I see, thanks!

--  
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/83dfce66-b3a8-4222-9ca4-93cbfe064a63%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/83dfce66-b3a8-4222-9ca4-93cbfe064a63%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:12am UTC](https://discuss.elastic.co/t/java-transport-client-which-hosts-to-add/18981/4 "2017-07-06T01:12:11Z")

</div>


