# Load balancing using Transport Client

**URL:** <https://discuss.elastic.co/t/load-balancing-using-transport-client/42129>\
**Category:** Elasticsearch\
**Created:** [February 18, 2016, 11:08am UTC](https://discuss.elastic.co/t/load-balancing-using-transport-client/42129 "2016-02-18T11:08:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navneet\_Mathpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navneet_mathpal/32/3677_2.png) [@Navneet\_Mathpal](https://discuss.elastic.co/u/Navneet_Mathpal)\
**Post date:** [February 18, 2016, 11:08am UTC](https://discuss.elastic.co/t/load-balancing-using-transport-client/42129/1 "2016-02-18T11:08:19Z")

</div>

Hi ,

I am using elastic 1.7.1 . Sending the data in elasticsearch through java I am using Transport client .  
I have three nodes which are running .  
so I am listing all the three nodes to Transport client like

> Settings settings = ImmutableSettings.settingsBuilder().put("client.transport.sniff", true).put("cluster.name",clusterName).build();

> TransportClient client = new TransportClient(settings).addTransportAddress(new InetSocketTransportAddress(host1, port)).addTransportAddress(new InetSocketTransportAddress(host2 , port)).addTransportAddress(new InetSocketTransportAddress(host3, port));

If any nodes goes down it shows me exception that - Exception caught on transport layer , closing connection.  
Is there any way that if any nodes goes down , elasticsearch will consider two nodes which are currently running without showing any exception/error.  
My requirement is the same as we do in logstash .. we listed down multiple hosts =\> [host1,host2,host3]  
if host1 goes down logstash will start pushing the data in another host which are currently available..

Any idea how to achive the same using transport client ?

Thanks

---

<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 5, 2017, 11:15pm UTC](https://discuss.elastic.co/t/load-balancing-using-transport-client/42129/2 "2017-07-05T23:15:11Z")

</div>


