Managing the index lifecycle | Elasticsearch Guide [7.0] (original) (raw)

Managing the index lifecycle

edit

The index lifecycle management (ILM) APIs enable you to automate how you want to manage your indices over time. Rather than simply performing management actions on your indices on a set schedule, you can base actions on other factors such as shard size and performance requirements.

You control how indices are handled as they age by attaching a lifecycle policy to the index template used to create them. You can update the policy to modify the lifecycle of both new and existing indices.

For time series indices, there are four stages in the index lifecycle:

The lifecycle policy governs how the index transitions through these stages and the actions that are performed on the index at each stage. The policy can specify:

For example, if you are indexing metrics data from a fleet of ATMs into Elasticsearch, you might define a policy that says:

  1. When the index reaches 50GB, roll over to a new index.
  2. Move the old index into the warm stage, mark it read only, and shrink it down to a single shard.
  3. After 7 days, move the index into the cold stage and move it to less expensive hardware.
  4. Delete the index once the required 30 day retention period is reached.

index lifecycle management does not support mixed-version cluster usage. Although it may be possible to create such new policies against newer-versioned nodes, there is no guarantee they will work as intended. New policies using new actions that do not exist in the oldest versioned node will cause errors.