And I noticed in our elasticsearch logs we got the following error:
[2019-05-22T00:16:46,994][ERROR][o.e.x.i.IndexLifecycleRunner] [qmfFc9w] policy [15-days] for index [logstash-2019.05.22] failed on step [{"phase":"hot","action":"rollover","name":"check-rollover-ready"}]. Moving to ERROR step
java.lang.IllegalArgumentException: setting [index.lifecycle.rollover_alias] for index [logstash-2019.05.22] is empty or not defined
at org.elasticsearch.xpack.core.indexlifecycle.WaitForRolloverReadyStep.evaluateCondition(WaitForRolloverReadyStep.java:50) [x-pack-core-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.indexlifecycle.IndexLifecycleRunner.runPeriodicStep(IndexLifecycleRunner.java:133) [x-pack-ilm-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.indexlifecycle.IndexLifecycleService.triggerPolicies(IndexLifecycleService.java:250) [x-pack-ilm-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.indexlifecycle.IndexLifecycleService.triggered(IndexLifecycleService.java:205) [x-pack-ilm-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine.notifyListeners(SchedulerEngine.java:168) [x-pack-core-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine$ActiveSchedule.run(SchedulerEngine.java:196) [x-pack-core-6.7.0.jar:6.7.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
I think I need to set the index.lifecycle.rollover_alias using something like the instructions here:
but it's not totally clear to me what the alias should be named. Any help would be much appreciated.
So since you are using rollover, ILM needs to know what alias to do the swap on when the new index is created. This is set in the index settings (or in the template, more likely), for example:
This creates the logstash-000001 index and also creates an alias called "logstash" that points to this new index. The ILM policy can now use this alias for swapping during the rollover.
Thanks @dakrone. One question though, I think (or thought) that I had done this through the UI already. If I view my ILM policies, then click on Actions -> Add policy to index template this sounds like it should do the same thing, would it not? I did do this through the UI. Is there a way to view the current settings and see if this is already setup?
Or maybe I'm confused about what this action in the UI does.
I made the changes that were suggested above and now I'm getting the following errors in my logstash.log file:
[2019-05-30T00:16:46,994][ERROR][o.e.x.i.IndexLifecycleRunner] [qmfFc9w] policy [15-days] for
index [logstash-2019.05.30] failed on step [{"phase":"hot","action":"rollover","name":"check- rollover-ready"}]. Moving to ERROR step
java.lang.IllegalArgumentException: index.lifecycle.rollover_alias [logstash] does not point to index [logstash-2019.05.30]
at org.elasticsearch.xpack.core.indexlifecycle.WaitForRolloverReadyStep.evaluateCondition(WaitForRolloverReadyStep.java:92) [x-pack-core-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.indexlifecycle.IndexLifecycleRunner.runPeriodicStep(IndexLifecycleRunner.java:133) [x-pack-ilm-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.indexlifecycle.IndexLifecycleService.triggerPolicies(IndexLifecycleService.java:250) [x-pack-ilm-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.indexlifecycle.IndexLifecycleService.triggered(IndexLifecycleService.java:205) [x-pack-ilm-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine.notifyListeners(SchedulerEngine.java:168) [x-pack-core-6.7.0.jar:6.7.0]
at org.elasticsearch.xpack.core.scheduler.SchedulerEngine$ActiveSchedule.run(SchedulerEngine.java:196) [x-pack-core-6.7.0.jar:6.7.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_201]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_201]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
I ran the commands almost exactly as shown above by @dakrone, the only thing I changed was "your-policy" to "15-day" which is what I named the policy in the UI when I created it. Perhaps index.lifecycle.rollover_alias needs to be "logstash-*" instead of "logstash"?
Would anyone be able to share with me how they have their index.lifecycle.rollover_alias set to? I'd really like to get this working, seems like I'm close and just barely off here.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.