Suppose I'm creating the ES index using beat system or logstash with date time interpolation.
how do I configure rolling over of index if size reaches at certain GBs in a single day? I did the following but I'm doing something wrong.
I created an ILM and then an index template and linked the ILM and let logstash create the new index. But index gives the following error. Any idea?
illegal_argument_exception: index.lifecycle.rollover_alias [test-index] does not point to index [test-index-2021.12.01]
What is the best practice? Create the index from beat/logstash with date or configuring entire rollover stuff from ES itself?
"rollover" : {
"max_size" : "300kb", <!----- This is not going to work well
"max_primary_shard_size" : "10gb",
"max_age" : "1d"
ILM is mean to work on the scale of GBs etc. so it will not rollover exactly on 300KB etc. I have written a bit about that here
Also you will never want 300KB indices that is very small and inefficient.
Well typically I would suggest starting with the defaults from say filebeat where all this is already configured... and works out of the box... get used to how elastic works.
Today we suggest Shard Sized based Rollover ... Time Based / Daily has some usefulness but can end up with many small indices and shards which can be wasteful.
And of course there are some nice docs here and here
@stephenb Thank you for your answer. 300kb, I set for testing rollover, for faster rollover. please ignore that.
I got your point, what I'm trying to do is set roll over via filebeat(using date) and also set additional roll over via shrads or size. How can I achieve that?
It does not really work that way... either you are using ILM or date based rollover in filebeat with index names not both.
The closest is to use ILM set Max Age 1d and a Max Shard Size.. that way it will either roll over 1 a day or or busier indices rollover at the shard size.
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.