I have spent the last 3 weeks off and on trying to get ILM to work. I have datastreams going but one client I am using (syslog-ng) does not yet know about datastreams and uses index in the _bulk rather than create.
I found the documentation tantalizingly incomplete. It seems that the authors made assumption about what was obvious that were clearly wrong in my case. Common problem with technical documentation.
The curicial bit of information that I lacked was the link between the rollover alias and the alias set on the initial creation of the index with "is_write_index": true and that this is what you use to write to the index.
Assuming that I have this all right! It seems to be working as expected.
So here is my howto for an sanity check and for anyone else as stupid as me who tries to set up ILM from scratch. I found this this link most useful but it still requires some joining of dots...
create your index and bootstrap the write/rollover alias:
Thanks for using Elasticsearch. I believe the steps you highlighted are correct, with the only note to execute step 3 (creating the index template) before step 1 (creating the index with the alias and is_write_indexconfiguration) in order for the index.lifecycle.name and index.lifecycle.rollover_alias settings to be configured automatically when you create the index (executing the steps in the order you posted would render the timeseries-000001 index as unmanaged by ILM as the said index.lifecycle... settings are not configured for the index, but only for future indices that match the template index pattern).
Otherwise, with the steps order you provided, there needs to be an extra step to associate the timeseries-policy and the rollover alias with the timeseries-000001 index using the update indices settings API.
The order of steps should be:
create index lifecycle policy
create index template that configures the lifecycle.name and lifecycle.rollover_alias settings
create the index with the alias configuration
We recognised some of the challenges associated with alias management and the is_write_index configuration and we developed data streams which I see you are already using for other indices.
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.