# Problem with Transport client and elasticsearch cluster behind load balancer

**URL:** <https://discuss.elastic.co/t/problem-with-transport-client-and-elasticsearch-cluster-behind-load-balancer/34989>\
**Category:** Elasticsearch\
**Created:** [November 18, 2015, 8:17pm UTC](https://discuss.elastic.co/t/problem-with-transport-client-and-elasticsearch-cluster-behind-load-balancer/34989 "2015-11-18T20:17:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tanjok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tanjok/32/22686_2.png) [@tanjok](https://discuss.elastic.co/u/tanjok)\
**Post date:** [November 18, 2015, 8:17pm UTC](https://discuss.elastic.co/t/problem-with-transport-client-and-elasticsearch-cluster-behind-load-balancer/34989/1 "2015-11-18T20:17:43Z")

</div>

Hallo,

I try to use elasticsearch for "search suggestion" in a java-webapplication.  
There are 2 nodes in the cluster behind a load balancer.  
I use elasticsearch 1.5

My problem is, if I use Transport Client with node host addresses there is no problem.

Client transportClient = new TransportClient(settings())  
.addTransportAddress(new InetSocketTransportAddress("elastic-suggest1.de", 9300))  
.addTransportAddress(new InetSocketTransportAddress("elastic-suggest2.de", 9300));

but if I try to use the load balancer with load balancer host address

Client client = new TransportClient(settings())  
.addTransportAddress(new InetSocketTransportAddress("load\_balancer\_host.de", 80));

I get an error  
elasticsearch[Blue Diamond][transport\_client\_worker][T#20]{New I/O worker #20} deploymentPhase   
WARN org.elasticsearch.transport.netty - [Blue Diamond] exception caught on transport layer [[id: 0x6f6cd7f0, /xx.xxx.xxx.xxx:41411 =\> load\_balancer\_host.de/xx.xxx.xxx.xxx:80]], closing connection  
java.io.IOException: Die Wartezeit fuer die Verbindung ist abgelaufen // =time out  
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)  
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)  
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)  
at sun.nio.ch.IOUtil.read(IOUtil.java:192)  
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:384)  
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.read(NioWorker.java:64)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)  
at org.elasticsearch.common.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)  
at org.elasticsearch.common.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)  
at org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)  
at org.elasticsearch.common.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)  
at java.lang.Thread.run(Thread.java:745)

and the second error:  
None of the configured nodes were available: [[suggest1][l6ReVYRRSeqz8CT9aSHnEA][elastic-suggest1.de][inet[load\_balancer\_host.de/xx.xxx.xxx.xxx:80]]]

Can somebody help me to find a solution for this problem?

best regards,  
Tanja

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 19, 2015, 3:06am UTC](https://discuss.elastic.co/t/problem-with-transport-client-and-elasticsearch-cluster-behind-load-balancer/34989/2 "2015-11-19T03:06:23Z")

</div>

Transport client establishes and maintains connections with other nodes and performs load balancing and fault detection between these connection. An external load balancing is hindering with this process in two ways - first of all it breaks idle connections (I think this is main cause for the error that you are seeing) and second since the transport client establishes the connection only ones, the load balancer basically limits the communication from the transport client to a single node that it connected to. In other words using load balancer on the transport protocol is a bad idea. You should ether remove the load balancer, or switch to REST client if having load balancer between the client and elasticsearch is a requirement.

---

<div class="post-metadata">

**Author:** ![sina309](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sina309/32/15020_2.png) [@sina309](https://discuss.elastic.co/u/sina309)\
**Post date:** [May 26, 2017, 12:51pm UTC](https://discuss.elastic.co/t/problem-with-transport-client-and-elasticsearch-cluster-behind-load-balancer/34989/3 "2017-05-26T12:51:14Z")

</div>

Great help, thx

---

<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, 9:59pm UTC](https://discuss.elastic.co/t/problem-with-transport-client-and-elasticsearch-cluster-behind-load-balancer/34989/4 "2017-07-05T21:59:59Z")

</div>


