โ† Elasticsearch learning path
Elasticsearch ยท Module 7 of 10

Shards, replicas and clusters

Elasticsearch spreads data across nodes for speed and safety.

๐Ÿ“– Key ideas

  1. An index is split into primary shards spread across nodes.
  2. Replica shards are copies on other nodes, for failover and extra read capacity.
  3. Cluster health is green, yellow or red.
  4. Yellow means all primaries are fine but some replicas are not assigned.
  5. Too many small shards waste memory; aim for tens of GB per shard.
๐Ÿ’ก Real-life example: Like splitting a huge library across branches, with photocopies of each section kept at another branch.
Primary shardHolds a slice of the index
Replica shardCopy of a primary on another node
NodeOne Elasticsearch server
YellowPrimaries OK, some replicas missing