Policies for rollover index

Hi Elasticsearch team

If i am implementing the policy in latest released version of elasticsearch 6.6
still i cant implement my policy

Please see my code

PUT _template/my
{
"index_patterns": ["abc-*"],
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1,
"index.lifecycle.name": "policy1",
"index.lifecycle.rollover_alias": "alias1"
}
}

PUT _ilm/policy/policy1
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover" : {
"max_docs": 2
}
}
}
}
}
}

PUT abc-000001
{
"aliases": {
"alias1":{
"is_write_index": true
}
}
}

POST alias1/my
{
"name":"AA"
}

In the elasticsearch 6.6 ,i am not able to rollover the index automatically.

Please let me know if i am doing any thing wrong in the above queries
Please help me in this

thanks in advance

Hi Dilip,

Assuming you indexed two documents (not only one), you still need to wait for the ILM interval to check for rollover.

I tested with your script, indexing two documents and then waiting the default interval (which is 10 minutes), it does in fact rollover and create a new index.

You can adjust indices.lifecycle.poll_interval to change the interval for testing to make it much shorter.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.