# Inquiry about load balancing of elasticsearch cluster

**URL:** <https://discuss.elastic.co/t/inquiry-about-load-balancing-of-elasticsearch-cluster/357187>\
**Category:** Kibana\
**Created:** [April 11, 2024, 7:13am UTC](https://discuss.elastic.co/t/inquiry-about-load-balancing-of-elasticsearch-cluster/357187 "2024-04-11T07:13:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwwryuwww](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wwwryuwww/32/74674_2.png) [@wwwryuwww](https://discuss.elastic.co/u/wwwryuwww)\
**Post date:** [April 11, 2024, 7:13am UTC](https://discuss.elastic.co/t/inquiry-about-load-balancing-of-elasticsearch-cluster/357187/1 "2024-04-11T07:13:19Z")

</div>

Hi, guys.

I am configuring an elastic stack with multiple servers and would like to know how load balancing is implemented for each connection to each component.

1. elastic agent -\> multiple elasticsearch or logstash nodes  
If I set the IP:port of multiple elasticsearch or logstash in the elastic agent using kibana's fleet-server configuration, will index traffic be distributed evenly to all listed nodes? Or, will all data be sent with the first node by default and be transmitted to the next node if the communication with a node a impossible?

2. logstash -\> elasticsearch data nodes  
If I set the IP:port of multiple elasticsearch using logstash.yml, will the traffic from logstash be sent evenly to all listed nodes? Or, will all data be sent with the first node of the list by default and be transmitted to the next node if the communication with the node is impossible?

3. kibana -\> elasticsearch coordination nodes  
If I set the IP:port of multiple elasticsearch using kibana.yml, will the request from kibana be sent evenly to all listed nodes? Or, will all requests be sent with the first node of the list by default and be transmitted to the next node if the communication with the node is impossible?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 11, 2024, 11:51am UTC](https://discuss.elastic.co/t/inquiry-about-load-balancing-of-elasticsearch-cluster/357187/2 "2024-04-11T11:51:14Z")

</div>

Hello,

For Elastic Agent it depends on the output, if the output is elasticsearch and you have multiple hosts configured, then it will use round robin to load balance between them, if the output is logstash you need to configure `loadbalance: true` for it to load balance between the nodes.

The documentation is [here](https://www.elastic.co/guide/en/fleet/current/elasticsearch-output.html#output-elasticsearch-commonly-used-settings) and [here](https://www.elastic.co/guide/en/fleet/current/logstash-output.html#output-logstash-commonly-used-settings).

For Logstash if you have multiple nodes in the hosts settings it will load balance between them using round robin as explained [here](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-hosts).

And for Kibana is the same thing, if the setting has multiple nodes it will load balance between them, the documentation is [here](https://www.elastic.co/guide/en/kibana/current/production.html#high-availability).

---

<div class="post-metadata">

**Author:** ![wwwryuwww](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wwwryuwww/32/74674_2.png) [@wwwryuwww](https://discuss.elastic.co/u/wwwryuwww)\
**Post date:** [April 11, 2024, 2:45pm UTC](https://discuss.elastic.co/t/inquiry-about-load-balancing-of-elasticsearch-cluster/357187/3 "2024-04-11T14:45:52Z")

</div>

I clearly understand thanks to you! All of them were written explicitly on the document.  
Thank you very much!
