ilm-index-lifecycle.asciidoc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. [role="xpack"]
  2. [[ilm-index-lifecycle]]
  3. === Index lifecycle
  4. ++++
  5. <titleabbrev>Index lifecycle</titleabbrev>
  6. ++++
  7. {ilm-init} defines five index lifecycle _phases_:
  8. * **Hot**: The index is actively being updated and queried.
  9. * **Warm**: The index is no longer being updated but is still being queried.
  10. * **Cold**: The index is no longer being updated and is queried infrequently. The information still
  11. needs to be searchable, but it's okay if those queries are slower.
  12. * **Frozen**: The index is no longer being updated and is queried rarely. The information still
  13. needs to be searchable, but it's okay if those queries are extremely slow.
  14. * **Delete**: The index is no longer needed and can safely be removed.
  15. An index's _lifecycle policy_ specifies which phases
  16. are applicable, what actions are performed in each phase,
  17. and when it transitions between phases.
  18. You can manually apply a lifecycle policy when you create an index.
  19. For time series indices, you need to associate the lifecycle policy with
  20. the index template used to create new indices in the series.
  21. When an index rolls over, a manually-applied policy isn't automatically applied to the new index.
  22. If you use {es}'s security features, {ilm-init} performs operations as the user
  23. who last updated the policy. {ilm-init} only has the
  24. <<defining-roles,roles>> assigned to the user at the time of the last policy
  25. update.
  26. [discrete]
  27. [[ilm-phase-transitions]]
  28. === Phase transitions
  29. {ilm-init} moves indices through the lifecycle according to their age.
  30. To control the timing of these transitions, you set a _minimum age_ for each phase. For an index to
  31. move to the next phase, all actions in the current phase must be complete and the index must be
  32. older than the minimum age of the next phase. Configured minimum ages must increase between
  33. subsequent phases, for example, a "warm" phase with a minimum age of 10 days can only be followed by
  34. a "cold" phase with a minimum age either unset, or >= 10 days.
  35. The minimum age defaults to zero, which causes {ilm-init} to move indices to the next phase
  36. as soon as all actions in the current phase complete.
  37. If an index has unallocated shards and the <<cluster-health,cluster health status>> is yellow,
  38. the index can still transition to the next phase according to its {ilm} policy.
  39. However, because {es} can only perform certain clean up tasks on a green
  40. cluster, there might be unexpected side effects.
  41. To avoid increased disk usage and reliability issues,
  42. address any cluster health problems in a timely fashion.
  43. [discrete]
  44. [[ilm-phase-execution]]
  45. === Phase execution
  46. {ilm-init} controls the order in which the actions in a phase are executed and
  47. what _steps_ are executed to perform the necessary index operations for each action.
  48. When an index enters a phase, {ilm-init} caches the phase definition in the index metadata.
  49. This ensures that policy updates don't put the index into a state where it can never exit the phase.
  50. If changes can be safely applied, {ilm-init} updates the cached phase definition.
  51. If they cannot, phase execution continues using the cached definition.
  52. {ilm-init} runs periodically, checks to see if an index meets policy criteria,
  53. and executes whatever steps are needed.
  54. To avoid race conditions, {ilm-init} might need to run more than once to execute all of the steps
  55. required to complete an action.
  56. For example, if {ilm-init} determines that an index has met the rollover criteria,
  57. it begins executing the steps required to complete the rollover action.
  58. If it reaches a point where it is not safe to advance to the next step, execution stops.
  59. The next time {ilm-init} runs, {ilm-init} picks up execution where it left off.
  60. This means that even if `indices.lifecycle.poll_interval` is set to 10 minutes and an index meets
  61. the rollover criteria, it could be 20 minutes before the rollover is complete.
  62. [discrete]
  63. [[ilm-phase-actions]]
  64. === Phase actions
  65. {ilm-init} supports the following actions in each phase. {ilm-init} executes the
  66. actions in the order listed.
  67. * Hot
  68. - <<ilm-set-priority,Set Priority>>
  69. - <<ilm-unfollow,Unfollow>>
  70. - <<ilm-rollover,Rollover>>
  71. - <<ilm-readonly,Read-Only>>
  72. - <<ilm-shrink,Shrink>>
  73. - <<ilm-forcemerge,Force Merge>>
  74. - <<ilm-searchable-snapshot, Searchable Snapshot>>
  75. * Warm
  76. - <<ilm-set-priority,Set Priority>>
  77. - <<ilm-unfollow,Unfollow>>
  78. - <<ilm-readonly,Read-Only>>
  79. - <<ilm-allocate,Allocate>>
  80. - <<ilm-migrate,Migrate>>
  81. - <<ilm-shrink,Shrink>>
  82. - <<ilm-forcemerge,Force Merge>>
  83. * Cold
  84. - <<ilm-set-priority,Set Priority>>
  85. - <<ilm-unfollow,Unfollow>>
  86. - <<ilm-readonly,Read-Only>>
  87. - <<ilm-searchable-snapshot, Searchable Snapshot>>
  88. - <<ilm-allocate,Allocate>>
  89. - <<ilm-migrate,Migrate>>
  90. * Frozen
  91. - <<ilm-searchable-snapshot, Searchable Snapshot>>
  92. * Delete
  93. - <<ilm-wait-for-snapshot,Wait For Snapshot>>
  94. - <<ilm-delete,Delete>>