|
2 | 2 | mapped_urls: |
3 | 3 | - https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html |
4 | 4 | - https://www.elastic.co/guide/en/elasticsearch/reference/current/overview-index-lifecycle-management.html |
5 | | - - https://www.elastic.co/guide/en/serverless/current/elasticsearch-differences.html#elasticsearch-differences-serverless-features-replaced |
6 | | - - https://www.elastic.co/guide/en/cloud-enterprise/current/ece-migrate-index-management.html |
7 | | - - https://www.elastic.co/guide/en/cloud/current/ec-configure-index-management.html |
8 | | - - https://www.elastic.co/guide/en/cloud/current/ec-migrate-index-management.html |
| 5 | + - https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-concepts.html |
9 | 6 | --- |
10 | 7 |
|
11 | 8 | # Index lifecycle management |
12 | 9 |
|
13 | | -% What needs to be done: Refine |
| 10 | +{{ilm-cap}} ({{ilm-init}}) provides an integrated and streamlined way to manage time-based data such as logs and metrics, making it easier to follow best practices for managing your indices. |
14 | 11 |
|
15 | | -% GitHub issue: docs-projects#376 |
| 12 | +You can configure {{ilm-init}} policies to automatically manage indices according to your performance, resiliency, and retention requirements. For example, you could use {{ilm-init}} to: |
16 | 13 |
|
17 | | -% Scope notes: Combine the linked resources. The "migrate to ILM" one is probably outdated now. |
| 14 | +* Spin up a new index when an index reaches a certain size or number of documents |
| 15 | +* Create a new index each day, week, or month and archive previous ones |
| 16 | +* Delete stale indices to enforce data retention standards |
18 | 17 |
|
19 | | -% Use migrated content from existing pages that map to this page: |
| 18 | +::::{tip} |
| 19 | +{{ilm-init}} is not available on {{es-serverless}}. |
20 | 20 |
|
21 | | -% - [ ] ./raw-migrated-files/elasticsearch/elasticsearch-reference/index-lifecycle-management.md |
22 | | -% - [ ] ./raw-migrated-files/elasticsearch/elasticsearch-reference/overview-index-lifecycle-management.md |
23 | | -% - [ ] ./raw-migrated-files/docs-content/serverless/elasticsearch-differences.md |
24 | | -% - [ ] ./raw-migrated-files/cloud/cloud-enterprise/ece-migrate-index-management.md |
25 | | -% - [ ] ./raw-migrated-files/cloud/cloud/ec-configure-index-management.md |
26 | | -% - [ ] ./raw-migrated-files/cloud/cloud/ec-migrate-index-management.md |
| 21 | +:::{dropdown} Why? |
| 22 | +In an {{ecloud}} or self-managed environment, ILM lets you automatically transition indices through data tiers according to your performance needs and retention requirements. This allows you to balance hardware costs with performance. {{es-serverless}} eliminates this complexity by optimizing your cluster performance for you. |
27 | 23 |
|
28 | | -% Internal links rely on the following IDs being on this page (e.g. as a heading ID, paragraph ID, etc): |
| 24 | +Data stream lifecycle is an optimized lifecycle tool that lets you focus on the most common lifecycle management needs, without unnecessary hardware-centric concepts like data tiers. |
| 25 | +::: |
| 26 | +:::: |
29 | 27 |
|
30 | | -$$$ilm-gs-alias-bootstrap$$$ |
| 28 | +::::{important} |
| 29 | +To use {{ilm-init}}, all nodes in a cluster must run the same version. Although it might be possible to create and apply policies in a mixed-version cluster, there is no guarantee they will work as intended. Attempting to use a policy that contains actions that aren’t supported on all nodes in a cluster will cause errors. |
| 30 | +:::: |
31 | 31 |
|
32 | | -$$$manage-time-series-data-without-data-streams$$$ |
| 32 | +## Actions |
33 | 33 |
|
34 | | -$$$ilm-gs-create-policy$$$ |
| 34 | +{{ilm-init}} policies can trigger actions like: |
35 | 35 |
|
36 | | -$$$ilm-gs-apply-policy$$$ |
| 36 | +* **Rollover**: Creates a new write index when the current one reaches a certain size, number of docs, or age. |
| 37 | +* **Shrink**: Reduces the number of primary shards in an index. |
| 38 | +* **Force merge**: Triggers a [force merge](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html) to reduce the number of segments in an index’s shards. |
| 39 | +* **Delete**: Permanently remove an index, including all of its data and metadata. |
| 40 | +* [And more](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-actions.html) |
37 | 41 |
|
38 | | -$$$ilm-gs-create-the-data-stream$$$ |
| 42 | +Each action has options you can use to specify index behavior and characteristics like: |
39 | 43 |
|
40 | | -$$$ilm-gs-check-progress$$$ |
| 44 | +* The maximum shard size, number of documents, or age at which you want to roll over to a new index. |
| 45 | +* The point at which the index is no longer being updated and the number of primary shards can be reduced. |
| 46 | +* When to force a merge to permanently remove documents marked for deletion. |
| 47 | +* The point at which the index can be moved to less performant hardware. |
| 48 | +* The point at which the availability is not as critical and the number of replicas can be reduced. |
| 49 | +* When the index can be safely deleted. |
41 | 50 |
|
42 | | -$$$ilm-gs-alias-apply-policy$$$ |
| 51 | +For example, if you are indexing metrics data from a fleet of ATMs into Elasticsearch, you might define a policy that says: |
43 | 52 |
|
44 | | -$$$ilm-gs-alias-check-progress$$$ |
| 53 | +1. When the total size of the index’s primary shards reaches 50GB, roll over to a new index. |
| 54 | +2. Move the old index into the warm phase, mark it read only, and shrink it down to a single shard. |
| 55 | +3. After 7 days, move the index into the cold phase and move it to less expensive hardware. |
| 56 | +4. Delete the index once the required 30 day retention period is reached. |
| 57 | + |
| 58 | +**Learn about all available actions in [Index lifecycle actions](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-actions.html).** |
| 59 | + |
| 60 | +## Create and manage {{ilm-init}} policies |
| 61 | + |
| 62 | +You can create and manage index lifecycle policies through [{{kib}} Management](/manage-data/lifecycle/index-lifecycle-management/index-management-in-kibana.md) or the [{{ilm-init}} APIs](https://www.elastic.co/docs/api/doc/elasticsearch/v8/group/endpoint-ilm). For more details on creating and managing index lifecycle policies refer to: |
| 63 | + |
| 64 | +* [Configure a lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md) |
| 65 | +* [Update a lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/policy-updates.md) |
| 66 | +* [Start and stop index lifecycle management](/manage-data/lifecycle/index-lifecycle-management/start-stop-index-lifecycle-management.md) |
| 67 | +* [Restore a managed data stream or index](/manage-data/lifecycle/index-lifecycle-management/restore-managed-data-stream-index.md) |
| 68 | +* [Customize built-in policies](/manage-data/lifecycle/index-lifecycle-management/tutorial-customize-built-in-policies.md) |
| 69 | + |
| 70 | +Default {{ilm}} policies are created automatically when you use {{agent}}, {{beats}}, or the {{ls}} {{es}} output plugin to send data to the {{stack}}. |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +::::{tip} |
| 75 | +To automatically back up your indices and manage snapshots, use [snapshot lifecycle policies](/deploy-manage/tools/snapshot-and-restore/create-snapshots.md#automate-snapshots-slm). |
| 76 | +:::: |
| 77 | + |
| 78 | +## Migrate to {{ilm-init}} |
| 79 | + |
| 80 | +For existing hot-warm deployments that are currently using index curation, migrating to ILM gives you more fine-grained control over the lifecycle of each index. Read more in: |
| 81 | + |
| 82 | +* [Manage existing indices](/manage-data/lifecycle/index-lifecycle-management/manage-existing-indices.md) |
| 83 | +* [Migrate to index lifecycle management](/manage-data/lifecycle/index-lifecycle-management/migrate-index-management.md) |
| 84 | +* [Migrate index allocation filters to node roles](/manage-data/lifecycle/index-lifecycle-management/migrate-index-allocation-filters-to-node-roles.md) |
0 commit comments