Elasticsearch ILM delete not working
1. 检查 policy.delete.actions是否为空
{ "test-kibana-index-lifecycle-policy" : { "version" : 3, "modified_date" : "2021-05-18T06:27:51.498Z", "policy" : { "phases" : { "hot" : { "min_age" : "0ms", "actions" : { "set_priority" : { "priority" : 100 } } }, "delete" : { "min_age" : "30d", "actions" : { "delete" : { "delete_searchable_snapshot" : true } } } } } } }
2. 检查 ILM的 operation_mode
GET _ilm/status { "operation_mode" : "RUNNING" }
3. 检查index的状态
{ "indices" : { "logstash-2021.02.26" : { "index" : "logstash-2021.02.26", "managed" : true, "policy" : "test-kibana-index-lifecycle-policy", "lifecycle_date_millis" : 1619145416884, "age" : "25.18d", "phase" : "hot", "phase_time_millis" : 1621319688074, "action" : "complete", "action_time_millis" : 1621319688108, "step" : "complete", "step_time_millis" : 1621319688108, "phase_execution" : { "policy" : "test-kibana-index-lifecycle-policy", "phase_definition" : { "min_age" : "0ms", "actions" : { "set_priority" : { "priority" : 100 } } }, "version" : 3, "modified_date_in_millis" : 1621319271498 } } } }
由于age不到30天,所以没有删除,可以设置index.lifecycle.origination_date (parse_origination_date) 来保证时间计算正确