Interview Prep/Real-World Interview/Data loss and corruption

The Elasticsearch cluster is RED after one data node died, and searches on the `logs-2026.11` index return errors.

IntermediateTroubleshootingData loss and corruption
Answer

Likely causes → Some primary shards have no copy left. The index had number_of_replicas: 0, or the replica lived on the same node, so losing the node lost the shard.

Diagnose →

curl -s localhost:9200/_cluster/health?pretty
curl -s 'localhost:9200/_cat/shards?v&h=index,shard,prirep,state,unassigned.reason' | grep UNASSIGNED
curl -s localhost:9200/_cluster/allocation/explain?pretty

Fix → Bring the node back if its disk survived; the shards recover. If the data is lost, restore the affected indices from a snapshot (POST _snapshot/repo/snap/_restore). As a last resort, allocate_empty_primary makes the cluster green again with that shard's data gone.

Prevent → At least one replica for any index you care about, shard allocation awareness across zones, and snapshot lifecycle management (SLM) to S3.

All Real-World Interview questions Roadmap: Interview readiness

More on Data loss and corruption