# ILM shards to be allocated to nodes matching the given filters

**URL:** <https://discuss.elastic.co/t/ilm-shards-to-be-allocated-to-nodes-matching-the-given-filters/286699>\
**Category:** Elasticsearch\
**Tags:** ilm-index-lifecycle-management\
**Created:** [October 14, 2021, 9:15am UTC](https://discuss.elastic.co/t/ilm-shards-to-be-allocated-to-nodes-matching-the-given-filters/286699 "2021-10-14T09:15:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lisiyu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lisiyu/32/91545_2.png) [@lisiyu](https://discuss.elastic.co/u/lisiyu)\
**Post date:** [October 14, 2021, 9:15am UTC](https://discuss.elastic.co/t/ilm-shards-to-be-allocated-to-nodes-matching-the-given-filters/286699/1 "2021-10-14T09:15:59Z")

</div>

I setting 3 data nodes: one hot;one warm;one cold. The `elasticsearch.yaml` ：

```auto
node.master: false
node.data: true
node.ingest: true
node.attr.box_type: hot

```

The ILM is :

```auto
PUT _ilm/policy/k8s-logs
{
    "policy":{
        "phases":{
            "warm":{
                "min_age":"1d",
                "actions":{
                    "allocate":{
                        "require":{
                            "box_type":"warm"
                        }
                    },
                    "readonly":{

                    },
                    "set_priority":{
                        "priority":50
                    }
                }
            },
            "cold":{
                "min_age":"2d",
                "actions":{
                    "allocate":{
                        "require":{
                            "box_type":"cold"
                        }
                    },
                    "readonly":{

                    },
                    "set_priority":{
                        "priority":0
                    }
                }
            },
            "hot":{
                "min_age":"0ms",
                "actions":{
                    "set_priority":{
                        "priority":100
                    }
                }
            },
            "delete":{
                "min_age":"2d",
                "actions":{
                    "delete":{
                        "delete_searchable_snapshot":true
                    }
                }
            }
        }
    }
}

```

The temple is

```auto
PUT k8s-core*/_settings

{
  "index": {
    "lifecycle": {
      "name": "k8s-logs"
    },
    "routing": {
      "allocation": {
        "require": {
          "box_type": "hot"
        }
      }
    },
    "refresh_interval": "30s",
    "number_of_shards": "2"
  }
}

```

I show the index setting

```auto
{
  "k8s-core-lb-reward-center-2021.10.13" : {
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "k8s-logs"
        },
        "routing" : {
          "allocation" : {
            "require" : {
              "box_type" : "warm"
            }
          }
        },
        "refresh_interval" : "30s",
        "number_of_shards" : "2",
        "blocks" : {
          "write" : "true"
        },
        "provided_name" : "k8s-core-lb-reward-center-2021.10.13",
        "creation_date" : "1634083226111",
        "priority" : "50",
        "number_of_replicas" : "1",
        "uuid" : "UtI6l2XsSKygdeZTmk-y1g",
        "version" : {
          "created" : "7130199"
        }
      }
    }
  }
}

```

I find the index was not assigned to the warm node. T ilm explain is

```auto
{
  "indices" : {
    "k8s-core-lb-reward-center-2021.10.13" : {
      "index" : "k8s-core-lb-reward-center-2021.10.13",
      "managed" : true,
      "policy" : "k8s-logs",
      "lifecycle_date_millis" : 1634083226111,
      "age" : "1.38d",
      "phase" : "warm",
      "phase_time_millis" : 1634169665340,
      "action" : "allocate",
      "action_time_millis" : 1634169686606,
      "step" : "check-allocation",
      "step_time_millis" : 1634169693780,
      "step_info" : {
        "message" : "Waiting for [2] shards to be allocated to nodes matching the given filters",
        "shards_left_to_allocate" : 2,
        "all_shards_active" : true,
        "number_of_replicas" : 1
      },
      "phase_execution" : {
        "policy" : "k8s-logs",
        "phase_definition" : {
          "min_age" : "1d",
          "actions" : {
            "allocate" : {
              "include" : { },
              "exclude" : { },
              "require" : {
                "box_type" : "warm"
              }
            },
            "readonly" : { },
            "set_priority" : {
              "priority" : 50
            }
          }
        },
        "version" : 12,
        "modified_date_in_millis" : 1634124436108
      }
    }
  }
}

```

I don't know how to fix it.

---

<div class="post-metadata">

**Author:** ![alfianaf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alfianaf/32/93192_2.png) [@alfianaf](https://discuss.elastic.co/u/alfianaf)\
**Post date:** [October 14, 2021, 9:33am UTC](https://discuss.elastic.co/t/ilm-shards-to-be-allocated-to-nodes-matching-the-given-filters/286699/2 "2021-10-14T09:33:15Z")

</div>

your shard is not allocated properly, try use [Cluster allocation API](https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html) to check whats the reason shard didn't allocate

---

<div class="post-metadata">

**Author:** ![lisiyu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lisiyu/32/91545_2.png) [@lisiyu](https://discuss.elastic.co/u/lisiyu)\
**Post date:** [October 14, 2021, 10:57am UTC](https://discuss.elastic.co/t/ilm-shards-to-be-allocated-to-nodes-matching-the-given-filters/286699/3 "2021-10-14T10:57:29Z")

</div>

There seems to be no problem

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "illegal_argument_exception",
        "reason" : "unable to find any unassigned shards to explain [ClusterAllocationExplainRequest[useAnyUnassignedShard=true,includeYesDecisions?=false]"
      }
    ],
    "type" : "illegal_argument_exception",
    "reason" : "unable to find any unassigned shards to explain [ClusterAllocationExplainRequest[useAnyUnassignedShard=true,includeYesDecisions?=false]"
  },
  "status" : 400
}

```

---

<div class="post-metadata">

**Author:** ![lisiyu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lisiyu/32/91545_2.png) [@lisiyu](https://discuss.elastic.co/u/lisiyu)\
**Post date:** [October 18, 2021, 9:55am UTC](https://discuss.elastic.co/t/ilm-shards-to-be-allocated-to-nodes-matching-the-given-filters/286699/4 "2021-10-18T09:55:18Z")

</div>

I fixed it.

---

<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:** [November 15, 2021, 9:55am UTC](https://discuss.elastic.co/t/ilm-shards-to-be-allocated-to-nodes-matching-the-given-filters/286699/5 "2021-11-15T09:55:38Z")

</div>

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