DBAtlas · Database operations atlas

Diagnose a stuck ILM step and retry it (_ilm/explain, _ilm/retry)

ElasticsearchIndex Lifecycle

Command

# Indices waiting in an error step:
GET log-*/_ilm/explain?only_errors=true
# Phase/action/step state and failure reason for one index:
GET log-000003/_ilm/explain?filter_path=indices.*.phase,indices.*.action,indices.*.step,indices.*.failed_step,indices.*.step_info,indices.*.is_auto_retryable_error
# After fixing the cause (example: missing rollover alias setting):
PUT log-000003/_settings
{
  "index.lifecycle.rollover_alias": "log"
}
POST log-000003/_ilm/retry
# Is ILM running (if STOPPED, POST _ilm/start):
GET _ilm/status

What it does

Shows indices waiting in the ERROR step, which phase/action/step they are stuck in and the failure reason (step_info); reruns the failed step after the cause is fixed.

When to use it

When rollover does not happen, old indices are not deleted, or the disk fills with indices ILM should have removed.

Caution

_ilm/retry only works for indices in the ERROR step; otherwise it returns 'has not encountered an error'. Common causes: rollover_alias setting missing or the alias has is_write_index on another index, not enough disk on a single node for shrink, an allocation rule (_tier_preference) cannot be satisfied. Deleting the policy does not remove ILM management from indices; remove the policy setting from the indices first.

Open in DBAtlas →

Related