I have created ILM policy with following configuration :
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_docs": 15000
}
}
},
"delete": {
"min_age": "1d",
"actions": {
"delete": {}
}
}
}
}
}
With the index_template
for matching indices.
Now when I bootstrap the index with initial index lets say <index-name>-000001
then the expectation is to rollover the index once docs.count
reaches to 15000.
The rollover is happening but at random docs.count and I'm not sure why it is happening.
Also docs.count is not updating I will have to manually hit refresh API, then docs count is getting updated at /_cat/indices
. Please let me know what is wrong in the config. Did I missing anything?
CodePudding user response:
The problem was with the refresh_interval
.
By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds.
My indices were not getting search request so couldn't update the indices.
I changed the default setting, I added "refresh_interval":"10s"
in my index template which inherited into my newly created index.
Also I changed the _cluster/setting
poll interval to 1 minute for testing and it worked!