The Elasticsearch cluster for logs goes red every Monday after the weekend batch jobs. How do you stabilise it?
AdvancedScenarioLogging Pipelines
Answer
Situation read → Likely too many small shards, unbalanced hot nodes, or disk watermarks being hit during a burst.
What I'd do →
- Check
GET _cluster/health,GET _cat/shards?v&s=store, andGET _cluster/allocation/explainfor unassigned shards. - Look at disk: the default
cluster.routing.allocation.disk.watermark.highis 90%; flood stage at 95% makes indices read-only. - Use ILM with rollover by size (
max_primary_shard_size: 50gb) instead of daily indices for tiny services. - Move to hot/warm/cold tiers with node attributes, and force-merge then shrink warm indices.
- Put a buffer (Kafka) in front so ingest spikes do not hit ES directly.
Why → Shard count and disk headroom drive most ES instability. Thousands of 1 GB shards waste heap.
Interview tip → Quote a target: keep shards in the 10–50 GB range and under ~20 shards per GB of heap.
More on Logging Pipelines
Developers SSH into servers and `grep` log files to debug. You are asked to centralise logging. Where do you start?BeginnerYour app writes free-text logs like `User 42 paid 19.99 in 340ms`. Why push for structured logging, and how?BeginnerLoki ingestion is failing with `stream limit exceeded` and the ingester memory is exploding. What happened?IntermediateFluent Bit pods on busy nodes are dropping logs during traffic spikes. How do you make the pipeline lossless?IntermediateFinance says the log bill doubled in a quarter. How do you cut it without losing debugging ability?IntermediateA Java stack trace shows up in Kibana as 40 separate log events. How do you fix it?Beginner