ilm-index-lifecycle.asciidoc 4.4 KB

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