# Java transportClient, several node?

**URL:** <https://discuss.elastic.co/t/java-transportclient-several-node/10485>\
**Category:** Elasticsearch\
**Created:** [January 24, 2013, 10:14am UTC](https://discuss.elastic.co/t/java-transportclient-several-node/10485 "2013-01-24T10:14:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DH1](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@DH1](https://discuss.elastic.co/u/DH1)\
**Post date:** [January 24, 2013, 10:14am UTC](https://discuss.elastic.co/t/java-transportclient-several-node/10485/1 "2013-01-24T10:14:17Z")

</div>

Hello everyone.

We are using the java API to index on or query our cluster. This cluster  
consist of three similar nodes.  
When Building the transport client that will be used for the constant  
indexation, we can specify several adresses for transport nodes.  
So, what would be better. Building the transport client with only one  
transport node, or building the transport client with a transport node for  
each node on the cluster?  
Query performance is by far more important than indexation performance, in  
our settings.

And if we have three different sources that index data on our cluster, that  
makes three transport clients. Would it be better to give each of them only  
one transport node, or should we give all of them a transport node for each  
node on our cluster?

Sorry if that is hard to understand. i realize that my english leaves very  
much to be desired.  
Regards,  
Deny

--

---

<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 24, 2013, 1:36pm UTC](https://discuss.elastic.co/t/java-transportclient-several-node/10485/2 "2013-01-24T13:36:55Z")

</div>

So I think your question is, if a TransportClient should connect to one or  
more nodes to achieve better performance.

The advantage of the transport client is that you can select the network  
path on which you want to transport the data to the cluster, and this  
allows remote access.

If the amount of data you send to the cluster does not max out the network  
capacity of the connection, you don't have to think about other connections  
to other nodes in the cluster.

You can add more network connections if you feel unsure if you are  
exceeding the network transport capacity. For example, if you have more  
than one network interface card, you can add another connection on another  
card

Note, the job of distributing the workload over the cluster nodes is done  
automatically by an internal routing algorithm, so it's not required to  
take extra precautions about workload balancing at client side.

Once you are connected, the TransportClient can "sniff" for other nodes, in  
order to be able to perform a failover if the node the transport client is  
connected to suddenly fails (for example, if the node is being shut down).

Best regards,

Jörg

--

---

<div class="post-metadata">

**Author:** ![DH1](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@DH1](https://discuss.elastic.co/u/DH1)\
**Post date:** [January 24, 2013, 1:54pm UTC](https://discuss.elastic.co/t/java-transportclient-several-node/10485/3 "2013-01-24T13:54:51Z")

</div>

Yes, that was exactly the info I was looking for.  
Thank a lot !

--

---

<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:54am UTC](https://discuss.elastic.co/t/java-transportclient-several-node/10485/4 "2017-07-06T02:54:44Z")

</div>


