What are Elasticsearch cluster health states?
IntermediateConceptLogging: ELK/EFK, Loki & Log Shippers
Answer
curl -s localhost:9200/_cluster/health?pretty
curl -s 'localhost:9200/_cat/shards?v&h=index,shard,prirep,state,unassigned.reason'
- Green: all primary and replica shards assigned.
- Yellow: all primaries assigned, some replicas not (common on a single-node cluster). No data loss but reduced redundancy.
- Red: at least one primary shard unassigned; some data is unsearchable and writes to it fail.
GET _cluster/allocation/explain tells you why a shard is unassigned (disk watermark, node left, allocation filter).
More on Logging: ELK/EFK, Loki & Log Shippers
What is the ELK stack, and what is EFK?BeginnerHow does Elasticsearch store and search logs?IntermediateWhat is ILM (Index Lifecycle Management) and why do log clusters need it?IntermediateWhat is an Elasticsearch data stream?AdvancedWhat is an index template and mapping, and what is a mapping explosion?AdvancedWhat does Logstash do compared with Beats?Intermediate