1
votes

I have 4 nodes,3 shards and 3 replicas in Elastic search cluster. I understands that data is split and stored into the shards. When query is requested, How data is fetched from all three shards?

Storage Structure :

Node 1: Shard1(Primary), Shard2(replica),Shard3(replica)
Node 2: Shard2(Primary), Shard1(replica)
Node 3: Shard3(Primary), Shard1(replica)
Node 4: Shard2(replica), Shard3(replica)

Thanks,
Kumar.

1

1 Answers

1
votes

For search query, data can be searched in a primary shard or its replica shard, as Elastic never assigns the replica shard of a primary on the same data node, replica improves the high-availability also as replica contains the copy so data can be searched from replica shard as well.

But as your data is divided into 3 primary shards, so for search query at least it needs to search 3 shards(primary or primary's shard).