index.asciidoc 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[index-lifecycle-management]]
  4. = Managing Indices
  5. :ilm: index lifecycle management
  6. :ILM: Index lifecycle management
  7. [partintro]
  8. --
  9. The {ILM} APIs enable you to automate how you want to manage your indices over
  10. time. Rather than simply performing management actions on your indices on a set
  11. schedule, you can base actions on other factors such as shard
  12. size and performance requirements.
  13. You control how indices are handled as they age by attaching a
  14. lifecycle policy to the index template used to create them. You can update
  15. the policy to modify the lifecycle of both new and existing indices.
  16. For time series indices, there are four stages in the index lifecycle:
  17. * Hot--the index is actively being updated and queried.
  18. * Warm--the index is no longer being updated, but is still being queried.
  19. * Cold--the index is no longer being updated and is seldom queried. The
  20. information still needs to be searchable, but it's okay if those queries are
  21. slower.
  22. * Delete--the index is no longer needed and can safely be deleted.
  23. The lifecycle policy governs how the index transitions through these stages and
  24. the actions that are performed on the index at each stage. The policy can
  25. specify:
  26. * The maximum size or age at which you want to roll over to a new index.
  27. * The point at which the index is no longer being updated and the number of
  28. primary shards can be reduced.
  29. * When to force a merge to permanently delete documents marked for deletion.
  30. * The point at which the index can be moved to less performant hardware.
  31. * The point at which the availability is not as critical and the number of
  32. replicas can be reduced.
  33. * When the index can be safely deleted.
  34. For example, if you are indexing metrics data from a fleet of ATMs into
  35. Elasticsearch, you might define a policy that says:
  36. . When the index reaches 5GB, roll over to a new index.
  37. . Move the old index into the warm stage, mark it read only, and shrink it down
  38. to a single shard.
  39. . After 7 days, move the index into the cold stage and move it to less expensive
  40. hardware.
  41. . Delete the index once the required 30 day retention period is reached.
  42. --
  43. :edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ilm/getting-started-ilm.asciidoc
  44. include::getting-started-ilm.asciidoc[]
  45. :edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ilm/using-policies--rollover.asciidoc
  46. include::using-policies-rollover.asciidoc[]
  47. :edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ilm/set-up-policy.asciidoc
  48. include::set-up-lifecycle-policy.asciidoc[]
  49. :edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ilm/update-lifecycle-policy.asciidoc
  50. include::update-lifecycle-policy.asciidoc[]
  51. :edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ilm/get-index-lifecycle-information.asciidoc
  52. include::get-index-lifecycle-information.asciidoc[]
  53. :edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ilm/pause-resume-ilm.asciidoc
  54. include::start-stop-ilm.asciidoc[]
  55. :edit_url: https://github.com/elastic/elasticsearch/edit/{branch}/x-pack/docs/en/ilm/apis/ilm-api.asciidoc
  56. include::{es-repo-dir}/ilm/apis/ilm-api.asciidoc[]