olivere / elastic

Deprecated: Use the official Elasticsearch client for Go at https://github.com/elastic/go-elasticsearch
https://olivere.github.io/elastic/
MIT License
7.39k stars 1.15k forks source link

Load balance between multiple master nodes #1656

Closed amirEBD closed 1 year ago

amirEBD commented 1 year ago

Which version of Elastic are you using?

elastic.v7 (for Elasticsearch 7.9)

Please describe the expected behavior

As I give multiple master nodes to olivere client. what will happend? Will it balance the load between masters (coordinaitors) or just choose one of them at the very first connection and continue the rest of it?

olivere commented 1 year ago

By default, it will do round robin between the nodes that a) are identified during the Sniffing process (if enabled) or b) you specify at startup (if sniffing is disabled). You can read more about all these things in the wiki.

In practice, you'd better leave load balancing up to DNS or Elasticsearch (by means of a dedicated coordinating node, I think).