I have some indices in the cluster that have index names as follows:
abc-asd-2023-10-09
abc-asd-2023-10-10
abc-asd-2023-10-11
There is no function running in the cluster to create daily indices.
I wanted to add these indices to the ILM policy, but it didn't work. Because ILM is asking for "rollover aliases".
I got an error:
illegal_argument_exception: setting [index.lifecycle.rollover_alias] for index [index name] is empty or not defined
You need to explicitly configure this alias one time when you bootstrap the initial index.
The index.lifecycle.rollover_alias setting must be configured for the rollover action to work.
Update the index settings to set index.lifecycle.rollover_alias
But I want to know how to add the rollover_alias setting for indices that are created daily.(as follows)
abc-asd-
abc-asd-2023-10-09
abc-asd-2023-10-10
abc-asd-2023-10-11
I understand the error message, but I wanted to rollover_alias for above index types.
Alright, sorry for not properly understanding the request
You mentioned you don't have a function running to create the indices, so I assume no data stream setup? How are the indices created? You can give them an alias at creation depending of the method?
If you're looking at automation for daily changing indices; take a look at this process. You create a lifecycle policy, and a template index with your "abc-asd-*" format and give it an alias through the wizard.
Rolling index requires the hard/actual index to end with -000001 when you created the index.
You create the index "abc-asd-2023-10-09-000001" with alias "abc-asd-2023-10-09" pointing to it (part of settings in the create index API payload).
Then when you issue the rollover index api with the rollover criteria, if it's met, then it'll create a new index name "abc-asd-2023-10-09-000002" and point the alias "abc-asd-2023-10-09" to it automatically. So all your future writes to "abc-asd-2023-10-09" will ended up in the index "abc-asd-2023-10-09-000002", etc.
When searching, you just use wildcard to search "abc-asd-2023-10-09*" for all the documents on that day.
I have not tried ILM so not sure how much of this is applicable. But rolling index is what I explained above.
Thank you for the reply.
Yes, It's not necessary to rollover the index. This index pattern already have daily index. I want to add these indices to ILM policy to automate the index deletion.
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.