How Do I Update the Lifecycle Policy of an Elasticsearch Cluster?
The lifecycle of Elasticsearch clusters is implemented using the Index State Management (ISM) of Open Distro. For details about how to configure policies related to the ISM template, see the Open Distro documentation.
- When a policy is created, the system writes a record to the .opendistro-ism-config index. In the record, _id is the policy name, and the content is the policy definition.
Figure 1 Writing a data record
- After a policy is bound to an index, the system writes another record to the .opendistro-ism-config index. The following figure shows the initial status of a record.
Figure 2 Initial data status
- Run the explain command. Only a policy ID will be returned.
GET _opendistro/_ism/explain/data2 { "data2" : { "index.opendistro.index_state_management.policy_id" : "policy1" } }
Open Distro will execute an initialization process to fill the policy content in the record. The following figure shows the initialized data.
Figure 3 Initialized data
After the initialization, min_index_age in the policy will be copied.
The initialized index uses a copy of this policy. The policy update will not take effect on the index.
- After the policy is modified, call the change_policy API to update the policy.
POST _opendistro/_ism/change_policy/data1 { "policy_id": "policy1" }
Related Information
For details about how to create and use a lifecycle policy, see Managing the Index Life Cycle.
Open Source Search Engine Consulting FAQs
- How Do I Set the Numbers of Index Copies to 0 in Batches?
- Why All New Index Shards Are Allocated to the Same Node?
- How Do I Create a Type Under an Index in an Elasticsearch 7.x Cluster?
- How Do I Configure a Two-Replica CSS Cluster?
- Can I Change the Number of Shards to Four with Two Replicas When There Is One Shard Set in the JSON File?
- What Are the Impacts If an Elasticsearch Cluster Has Too Many Shards?
- How Do I Check the Numbers of Shards and Replicas in a Cluster on the CSS Console?
- How Do I Query Index Data on Kibana in an ES Cluster?
- Can I Stop a CSS Cluster?
- Does the Value i of node.roles Indicate an Ingest Node?
- How Do I Set the Default Maximum Number of Records Displayed on a Page for an Elasticsearch Cluster
- How Do I Update the Lifecycle Policy of an Elasticsearch Cluster?
- How Do I Configure the Threshold for CSS Slow Query Logs?
- How Do I Delete Index Data?
- How Do I Clear the Cache of a CSS Cluster?
- Why Does the Disk Usage Increase After the delete_by_query Command Was Executed to Delete Data?
- How Do I Clear Expired Data to Release Storage Space?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore