ILM shards to be allocated to nodes matching the given filters

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

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

The ILM is :

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

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

{
  "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

{
  "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.

your shard is not allocated properly, try use Cluster allocation API to check whats the reason shard didn't allocate

There seems to be no problem

{
  "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
}

I fixed it.

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