โ Elasticsearch learning pathElasticsearch ยท Module 7 of 10
Shards, replicas and clusters
Elasticsearch spreads data across nodes for speed and safety.
๐ Key ideas
- An index is split into primary shards spread across nodes.
- Replica shards are copies on other nodes, for failover and extra read capacity.
- Cluster health is green, yellow or red.
- Yellow means all primaries are fine but some replicas are not assigned.
- 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