pe_brgs02
pe_brgs02

Reputation: 23

In a 3 node Elasticsearch cluster, a search is distributed through all nodes?

If I have 3 data nodes and perform a query with a lot of aggregations, this search is distributed through all cluster data nodes?

Or the Elasticsearch elects one node to query and aggregate the data? Acting as a load balancer and not as like a "distributed map/reduce"

Upvotes: 2

Views: 523

Answers (1)

Val
Val

Reputation: 217554

If the index you're querying contains more than one shard (whether primary or replica), then those shards will be located on different nodes, hence the query will be distributed to each node that hosts a shard of the index you're querying.

One data node will receive your request and act as the coordinating node. It will check the cluster state to figure out where the shards are located, then it will forward the request to each node hosting a shard, gather the results and send them back to the client.

Upvotes: 2

Related Questions