I am using Logstash to create a daily index in ElasticSearch.
This time, I tried to create an index using an index template, but I noticed that ElasticSearch was generating the following ILM error.
$ tail -n 30 /var/log/elasticsearch/elasticsearch.log
... snip ...
[2021-07-08T15:09:12,202][ERROR][o.e.x.i.IndexLifecycleRunner] [ITS-ELST-01] policy [its_index-policy] for index [sro-msp-error-2021.07.08] failed on step [{"phase":"hot","action":"rollover","name":"check-rollover-ready"}]. Moving to ERROR step
java.lang.IllegalArgumentException: index.lifecycle.rollover_alias [its_index-policy-alias] does not point to index [sro-msp-error-2021.07.08]
at org.elasticsearch.xpack.core.ilm.WaitForRolloverReadyStep.evaluateCondition(WaitForRolloverReadyStep.java:124) [x-pack-core-7.12.0.jar:7.12.0]
at org.elasticsearch.xpack.ilm.IndexLifecycleRunner.runPeriodicStep(IndexLifecycleRunner.java:175) [x-pack-ilm-7.12.0.jar:7.12.0]
at org.elasticsearch.xpack.ilm.IndexLifecycleService.triggerPolicies(IndexLifecycleService.java:335) [x-pack-ilm-7.12.0.jar:7.12.0]
at org.elasticsearch.xpack.ilm.IndexLifecycleService.triggered(IndexLifecycleService.java:273) [x-pack-ilm-7.12.0.jar:7.12.0]
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine.notifyListeners(SchedulerEngine.java:184) [x-pack-core-7.12.0.jar:7.12.0]
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine$ActiveSchedule.run(SchedulerEngine.java:217) [x-pack-core-7.12.0.jar:7.12.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
at java.lang.Thread.run(Thread.java:832) [?:?]
... snip ...
What does this error mean and how do I respond to it?
Just in case, I am attaching the description of the index policy and index template we are using.
$ curl -X GET http://localhost:9200/_ilm/policy/its_index-policy?pretty
{
"its_index-policy" : {
"version" : 1,
"modified_date" : "2021-07-07T05:58:15.664Z",
"policy" : {
"phases" : {
"warm" : {
"min_age" : "5d",
"actions" : { }
},
"hot" : {
"min_age" : "0ms",
"actions" : {
"rollover" : {
"max_size" : "20gb",
"max_age" : "2d",
"max_docs" : 50000000
}
}
},
"delete" : {
"min_age" : "60d",
"actions" : {
"delete" : {
"delete_searchable_snapshot" : true
}
}
}
}
}
}
}
$ curl -X GET http://localhost:9200/_index_template/its_index_template?pretty
{
"index_templates" : [
{
"name" : "its_index_template",
"index_template" : {
"index_patterns" : [
"sro-*",
"max-*"
],
"template" : {
"settings" : {
"index" : {
"lifecycle" : {
"name" : "its_index-policy",
"rollover_alias" : "its_index-policy-alias"
},
"number_of_shards" : "1",
"number_of_replicas" : "0"
}
},
"mappings" : {
"_source" : {
"enabled" : true
},
"properties" : {
"created_at" : {
"format" : "EEE MMM dd HH:mm:ss Z yyyy",
"type" : "date"
},
"host_name" : {
"type" : "keyword"
}
}
},
"aliases" : {
"its" : { }
}
},
"composed_of" : [
"logs-settings"
],
"priority" : 500,
"version" : 1,
"_meta" : {
"description" : "its index template"
}
}
}
]
}