# Failure load balance

**URL:** <https://discuss.elastic.co/t/failure-load-balance/279373>\
**Category:** Elasticsearch\
**Created:** [July 22, 2021, 11:53am UTC](https://discuss.elastic.co/t/failure-load-balance/279373 "2021-07-22T11:53:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.elastic.co/u/mcosta)\
**Post date:** [July 22, 2021, 11:53am UTC](https://discuss.elastic.co/t/failure-load-balance/279373/1 "2021-07-22T11:53:11Z")

</div>

Hi all,

New, RHEL based, 5-node elasticsearch cluster installed here (ver 7.13.3).

Elasticsearch clients are Logstash and some In-house applications.

My main concern is node failure.

I know that logstash would load balance connections to elasticsearch (pipeline output section's 'hosts' variable contains all node names) but what about other applications?

Do I need to configure an external load balancer (like haproxy or nginx) in front of elasticsearch so other applications can point to it instead of pointing to one node (or even an array of nodes)? Or is any other/better solution?

Thank you.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 22, 2021, 3:00pm UTC](https://discuss.elastic.co/t/failure-load-balance/279373/2 "2021-07-22T15:00:17Z")

</div>

How are you connecting your other applications to Elasticsearch? All Elasticsearch clients have a feature called sniffing, for example the java one here [Usage | Java REST Client [7.13] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.13/_usage.html)

---

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.elastic.co/u/mcosta)\
**Post date:** [July 22, 2021, 4:00pm UTC](https://discuss.elastic.co/t/failure-load-balance/279373/3 "2021-07-22T16:00:28Z")

</div>

Thank you for your answer.

I don't know how applications are developed (or what language(s) are used) but I'll point developers to that sniffing feature. It seams very useful and if I understood correctly, after an initial successful connect application should know available nodes and can also control when to update node list (even in case of failure).

I assume the reason for not finding much info on this subject (external load balancer) is because applications should somehow take care of it, right?

Thanks

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 23, 2021, 8:07am UTC](https://discuss.elastic.co/t/failure-load-balance/279373/4 "2021-07-23T08:07:10Z")

</div>

A load balancer would work as well, but that is another component you have to run and maintain yourself, which also sounds like a single point of failure. Given the fact that the official clients support sniffing, I personally prefer running less infrastructure with a bit more logic within the application, but that is subjective I guess 🙂

---

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.elastic.co/u/mcosta)\
**Post date:** [July 23, 2021, 9:16am UTC](https://discuss.elastic.co/t/failure-load-balance/279373/5 "2021-07-23T09:16:10Z")

</div>

Totally agree 🙂

Thank you

---

<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:** [August 20, 2021, 9:16am UTC](https://discuss.elastic.co/t/failure-load-balance/279373/6 "2021-08-20T09:16:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
