# Problem with Index lifecycle management

**URL:** <https://discuss.elastic.co/t/problem-with-index-lifecycle-management/189143>\
**Category:** Elasticsearch\
**Created:** [July 5, 2019, 5:19pm UTC](https://discuss.elastic.co/t/problem-with-index-lifecycle-management/189143 "2019-07-05T17:19:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kabali12345](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kabali12345](https://discuss.elastic.co/u/kabali12345)\
**Post date:** [July 5, 2019, 5:19pm UTC](https://discuss.elastic.co/t/problem-with-index-lifecycle-management/189143/1 "2019-07-05T17:19:20Z")

</div>

Hi All...  
Here I am trying to create an Index LifeCycle management policy which

1. Initially store the index in the hot node for maximum 10 minutes.
2. Next, that index should move to warm node, forcemerge and Shrink operations need to be performed if the minimum age of the index is 10 minutes older.
3. The index should move to the cold node if the minimum age of the index is 15 minutes.
4. The index should be deleted if the min\_age of the index is 20 minutes.  
And Here the ilm policy

> ```
> PUT _ilm/policy/hot-warm-cold-delete-20min
> {
> "policy": {
> "phases": {
> "hot": {
> "actions": {
> "rollover": {
> "max_age":"10m"
> },
> "set_priority": {
> "priority": 50
> }
> }
> },
> "warm": {
> "min_age": "10m",
> "actions": {
> "forcemerge": {
> "max_num_segments": 1
> },
> "shrink": {
> "number_of_shards": 1
> },
> "allocate": {
> "require": {
> "box_type": "warm"
> }
> },
> "set_priority": {
> "priority": 25
> }
> }
> },
> "cold": {
> "min_age": "15m",
> "actions": {
> "set_priority": {
> "priority": 0
> },
> "freeze": {},
> "allocate": {
> "require": {
> "box_type": "cold"
> }
> }
> }
> },
> "delete": {
> "min_age": "20m",
> "actions": {
> "delete": {}
> }
> }
> }
> }
> }
> 
> ```

And Here is the template that I used

> ```
> PUT _template/hot-warm-cold-delete-60days-template
> {
> "order": 10,
> "index_patterns": ["titanic-*"],
> "settings": {
> "number_of_shards": 2,
> "number_of_replicas": "0",
> "index.routing.allocation.require.box_type": "hot",
> "index.lifecycle.name": "hot-warm-cold-delete-20min"
> }
> }
> 
> ```

Then I have indexed titanic-1 index and two shards were allowcated on hot node, then I waited for 10 minutes and more but shardes were not relocated to warm, cold nodes and index is also not deleted.  
And I used logstash to index the data and enabled ilm\_enabled =\> true in output elasticsearch plugin.  
And I have 3 node cluster and each node has one of the following attribute  
node.attr.box\_type: hot  
node.attr.box\_type: warm  
node.attr.box\_type: cold

Please correct me if I am doing wrong

Thank You...

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 5, 2019, 5:37pm UTC](https://discuss.elastic.co/t/problem-with-index-lifecycle-management/189143/2 "2019-07-05T17:37:37Z")

</div>

I belueve ILM by default only checks every 10 minutes which is fine for real use cases but not optimal for these kind of tests.

---

<div class="post-metadata">

**Author:** ![kabali12345](https://avatars.discourse-cdn.com/v4/letter/k/6a8cbe/32.png) [@kabali12345](https://discuss.elastic.co/u/kabali12345)\
**Post date:** [July 5, 2019, 5:44pm UTC](https://discuss.elastic.co/t/problem-with-index-lifecycle-management/189143/3 "2019-07-05T17:44:49Z")

</div>

Thank you for your response.  
So If I decreasing ILM checks time to 5 minutes, will my policy workes?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 2, 2019, 5:44pm UTC](https://discuss.elastic.co/t/problem-with-index-lifecycle-management/189143/4 "2019-08-02T17:44:52Z")

</div>

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