How are shards created/allocated when we are using an index pattern such that each day's log is written to a separate index (eg my_index_emailf_log-* , my_index_emailf_log-dd-mm-yyyy .)
Suppose we have specified 1 primary shard and 1 replica shard for that index pattern,
will a separate primary shard and separate replica shard gets created daily for each index that gets created daily with the name for eg my_index_emailf_log-31-10-2021?
Whatever the shard and replica setting are in the index template each new index that matches the pattern in the template will be created with the defined setting from the template and thus will have the defined number of Primary and Replica shards.
So yes each daily index will have the defined Primary and Replica shads, in your example 1 Primary and 1 Replica
in that case there will be lots of shards created as days pass by. Is it an issue ?. Is it the correct way to do? or should i create a monthly index?
thanks and regards
shini
It could be an issue but that depends on the number of indices and the size of your nodes etc , that is why ILM policies can be defined as sized based instead of time based, but monthly can work as well.
For more info on sizing shards perhaps take a look 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.