# ILM shrink and warm node

**URL:** <https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [December 17, 2021, 6:39pm UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357 "2021-12-17T18:39:46Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [December 17, 2021, 6:39pm UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/1 "2021-12-17T18:39:46Z")

</div>

I have setup ILM policy with shrink but not working. what am I missing

```auto
PUT _ilm/policy/metricbeat
{
  "policy": {
    "phases": {
      "hot": {
        "min_age": "0ms",
        "actions": {
          "rollover": {
            "max_size": "120gb",
            "max_age": "30d"
          }
        }
      },
      "warm": {
        "min_age": "30d",
        "actions": {
          "set_priority": {
            "priority": 50
          },
          "shrink": {
            "number_of_shards": 2
          },
          "allocate": {
            "number_of_replicas": 0
          }
        }
      }
    }
  }
}

```

I also want this to move to warm node which I have define via Elasticsearch.yml

```auto
# grep node.role /etc/elasticsearch/elasticsearch.yml
node.roles: [data_warm]

```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/f/7feb1e6f272b95335526324b4d08d69ad6af8d28.png)

this does not seems to be taking place. which step did I miss.  
ILM policy is being executed because my data has 0 replica

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [December 20, 2021, 5:05pm UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/2 "2021-12-20T17:05:21Z")

</div>

anyone any idea?

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [December 20, 2021, 5:14pm UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/3 "2021-12-20T17:14:13Z")

</div>

How many shards does your index originally have?

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [December 20, 2021, 5:31pm UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/4 "2021-12-20T17:31:42Z")

</div>

Six

I want that to be shrink to 2

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [December 20, 2021, 5:57pm UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/5 "2021-12-20T17:57:11Z")

</div>

Do you have anything in the logs, probably the in the master node logs?

What happens when you try to shrink the index using the shrink API, any error? Can you try that?

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [December 20, 2021, 10:24pm UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/6 "2021-12-20T22:24:28Z")

</div>

this message on elastic log. and it does removes replica for this index.  
but not shrink it

```auto

[2021-12-20T10:38:05,566][INFO][o.e.x.i.IndexLifecycleTransition] [houelkm12] moving index [metricbeat-7.12.0-2021.12.19-000075] from [{"phase":"hot","action":"rollover","name":"set-indexing-complete"}] to [{"phase":"hot","action":"complete","name":"complete"}] in policy [metricbeat]

```

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [December 21, 2021, 1:08am UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/7 "2021-12-21T01:08:07Z")

</div>

I have four node with warm node setup

node.roles: [data\_warm]

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [December 21, 2021, 1:23am UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/8 "2021-12-21T01:23:39Z")

</div>

As test I went and change warm phase from 30 to 29 and here is new message pop up. it looks like it move to warm but no shrink

```auto
[2021-12-20T19:19:19,719][INFO][o.e.x.i.a.TransportPutLifecycleAction] [houelkm12] updating index lifecycle policy [g2insight-sys]
[2021-12-20T19:19:20,332][INFO][o.e.x.i.IndexLifecycleTransition] [houelkm12] moving index [metricbeat-7.12.0-2021.11.22-000034] from [{"phase":"hot","action":"complete","name":"complete"}] to [{"phase":"warm","action":"set_priority","name":"set_priority"}] in policy [metricbeat]
[2021-12-20T19:19:20,748][INFO][o.e.x.i.IndexLifecycleTransition] [houelkm12] moving index [metricbeat-7.12.0-2021.11.22-000034] from [{"phase":"warm","action":"set_priority","name":"set_priority"}] to [{"phase":"warm","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] in policy [metricbeat]
[2021-12-20T19:19:20,823][INFO][o.e.x.i.IndexLifecycleTransition] [houelkm12] moving index [metricbeat-7.12.0-2021.11.22-000034] from [{"phase":"warm","action":"unfollow","name":"branch-check-unfollow-prerequisites"}] to [{"phase":"warm","action":"allocate","name":"allocate"}] in policy [metricbeat]
[2021-12-20T19:19:20,902][INFO][o.e.c.m.MetadataUpdateSettingsService] [houelkm12] updating number_of_replicas to [0] for indices [metricbeat-7.12.0-2021.11.22-000034]
[2021-12-20T19:19:21,179][INFO][o.e.x.i.IndexLifecycleTransition] [houelkm12] moving index [metricbeat-7.12.0-2021.11.22-000034] from [{"phase":"warm","action":"allocate","name":"allocate"}] to [{"phase":"warm","action":"allocate","name":"check-allocation"}] in policy [metricbeat]
[2021-12-20T19:19:22,677][INFO][o.e.x.i.IndexLifecycleTransition] [houelkm12] moving index [metricbeat-7.12.0-2021.11.22-000034] from [{"phase":"warm","action":"allocate","name":"check-allocation"}] to [{"phase":"warm","action":"migrate","name":"branch-check-skip-action"}] in policy [metricbeat]
[2021-12-20T19:19:22,679][INFO][o.e.x.i.IndexLifecycleTransition] [houelkm12] moving index [metricbeat-7.12.0-2021.11.22-000034] from [{"phase":"warm","action":"migrate","name":"branch-check-skip-action"}] to [{"phase":"warm","action":"migrate","name":"migrate"}] in policy [metricbeat]

[2021-12-20T19:19:23,598][INFO][o.e.x.i.IndexLifecycleTransition] [houelkm12] moving index [metricbeat-7.12.0-2021.11.22-000034] from [{"phase":"warm","action":"migrate","name":"migrate"}] to [{"phase":"warm","action":"migrate","name":"check-migration"}] in policy [metricbeat]

```

---

<div class="post-metadata">

**Author:** ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)\
**Post date:** [December 21, 2021, 2:42pm UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/9 "2021-12-21T14:42:16Z")

</div>

it is so weird. last night index just got shrink after I change warm phase date from 30 to 29

---

<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:** [January 18, 2022, 2:42pm UTC](https://discuss.elastic.co/t/ilm-shrink-and-warm-node/292357/10 "2022-01-18T14:42:48Z")

</div>

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