我刚打酱油去了,不好意思

ILM:Waiting for [10] shards to be allocated to nodes matching the given filters

Elasticsearch | 作者 harrison520 | 发布于2020年01月11日 | 阅读数:4134

使用ILM 实现zabbix历史数据冷热分离,到期的热索引,属性变成warm,但并不会自动迁移到warm节点

"str-000010" : {
"step" : "check-allocation",
"step_time_millis" : 1578727525452,
"step_info" : {
"message" : "Waiting for [10] shards to be allocated to nodes matching the given filters",
"shards_left_to_allocate" : 10,
"all_shards_active" : true,
"actual_replicas" : 1
}
已邀请:

harrison520

赞同来自:

当重数据节点后,warm状态的索引会从hot节点迁移到warm节点,但并不会完全迁移,
GET /*/_ilm/explain?filter_path=indices.*.step*

"str-000010" : {
      "step" : "check-allocation",
      "step_time_millis" : 1578727525452,
      "step_info" : {
        "message" : "Waiting for [10] shards to be allocated to nodes matching the given filters",
        "shards_left_to_allocate" : 10,
        "all_shards_active" : true,
        "actual_replicas" : 1
      }


GET _cluster/settings
{
  "persistent" : {
    "cluster" : {
      "routing" : {
        "rebalance" : {
          "enable" : "all"
        },
        "allocation" : {
          "enable" : "none"
        }
      }
    },
    "indices" : {
      "lifecycle" : {
        "poll_interval" : "10m"
      }
    },
    "xpack" : {
      "monitoring" : {
        "collection" : {
          "enabled" : "true"
        }
      }
    }
  },
  "transient" : {
    "cluster" : {
      "routing" : {
        "rebalance" : {
          "enable" : "all"
        },
        "allocation" : {
          "enable" : "all"
        }
      }
    }
  }
}


索引配置如下:

{
  "settings": {
    "index": {
      "lifecycle": {
        "name": "zabbix-history",
        "rollover_alias": "str",
        "indexing_complete": "true"
      },
      "routing": {
        "allocation": {
          "require": {
            "data": "warm"
          }
        }
      },
      "number_of_shards": "5",
      "provided_name": "str-000010",
      "creation_date": "1576048522690",
      "priority": "50",
      "number_of_replicas": "1",
      "uuid": "PyKhdWAlTN-8ZjaI6pEUiw",
      "version": {
        "created": "6080499"
      }
    }
  },
  "defaults": {
    "index": {
      "max_inner_result_window": "100",
      "unassigned": {
        "node_left": {
          "delayed_timeout": "1m"
        }
      },
      "max_terms_count": "65536",
      "routing_partition_size": "1",
      "max_docvalue_fields_search": "100",
      "merge": {
        "scheduler": {
          "max_thread_count": "4",
          "auto_throttle": "true",
          "max_merge_count": "9"
        },
        "policy": {
          "reclaim_deletes_weight": "2.0",
          "floor_segment": "2mb",
          "max_merge_at_once_explicit": "30",
          "max_merge_at_once": "10",
          "max_merged_segment": "5gb",
          "expunge_deletes_allowed": "10.0",
          "segments_per_tier": "10.0",
          "deletes_pct_allowed": "33.0"
        }
      },
      "max_refresh_listeners": "1000",
      "max_regex_length": "1000",
      "load_fixed_bitset_filters_eagerly": "true",
      "number_of_routing_shards": "5",
      "write": {
        "wait_for_active_shards": "1"
      },
      "mapping": {
        "coerce": "false",
        "nested_fields": {
          "limit": "50"
        },
        "depth": {
          "limit": "20"
        },
        "ignore_malformed": "false",
        "total_fields": {
          "limit": "1000"
        }
      },
      "source_only": "false",
      "soft_deletes": {
        "enabled": "false",
        "retention": {
          "operations": "0"
        },
        "retention_lease": {
          "period": "12h"
        }
      },
      "max_script_fields": "32",
      "query": {
        "default_field": [
          "*"
        ],
        "parse": {
          "allow_unmapped_fields": "true"
        }
      },
      "format": "0",
      "frozen": "false",
      "sort": {
        "missing": ,
        "mode": ,
        "field": ,
        "order":
      },
      "codec": "default",
      "max_rescore_window": "10000",
      "max_adjacency_matrix_filters": "100",
      "gc_deletes": "60s",
      "optimize_auto_generated_id": "true",
      "max_ngram_diff": "1",
      "translog": {
        "generation_threshold_size": "64mb",
        "flush_threshold_size": "512mb",
        "sync_interval": "5s",
        "retention": {
          "size": "512mb",
          "age": "12h"
        },
        "durability": "REQUEST"
      },
      "auto_expand_replicas": "false",
      "mapper": {
        "dynamic": "true"
      },
      "requests": {
        "cache": {
          "enable": "true"
        }
      },
      "data_path": "",
      "highlight": {
        "max_analyzed_offset": "-1"
      },
      "routing": {
        "rebalance": {
          "enable": "all"
        },
        "allocation": {
          "enable": "all",
          "total_shards_per_node": "-1"
        }
      },
      "search": {
        "slowlog": {
          "level": "TRACE",
          "threshold": {
            "fetch": {
              "warn": "-1",
              "trace": "-1",
              "debug": "-1",
              "info": "-1"
            },
            "query": {
              "warn": "-1",
              "trace": "-1",
              "debug": "-1",
              "info": "-1"
            }
          }
        },
        "throttled": "false"
      },
      "fielddata": {
        "cache": "node"
      },
      "default_pipeline": "_none",
      "max_slices_per_scroll": "1024",
      "shard": {
        "check_on_startup": "false"
      },
      "xpack": {
        "watcher": {
          "template": {
            "version": ""
          }
        },
        "version": "",
        "ccr": {
          "following_index": "false"
        }
      },
      "percolator": {
        "map_unmapped_fields_as_text": "false",
        "map_unmapped_fields_as_string": "false"
      },
      "allocation": {
        "max_retries": "5"
      },
      "refresh_interval": "1s",
      "indexing": {
        "slowlog": {
          "reformat": "true",
          "threshold": {
            "index": {
              "warn": "-1",
              "trace": "-1",
              "debug": "-1",
              "info": "-1"
            }
          },
          "source": "1000",
          "level": "TRACE"
        }
      },
      "compound_format": "0.1",
      "blocks": {
        "metadata": "false",
        "read": "false",
        "read_only_allow_delete": "false",
        "read_only": "false",
        "write": "false"
      },
      "max_result_window": "10000",
      "store": {
        "stats_refresh_interval": "10s",
        "type": "",
        "fs": {
          "fs_lock": "native"
        },
        "preload":
      },
      "queries": {
        "cache": {
          "enabled": "true"
        }
      },
      "ttl": {
        "disable_purge": "false"
      },
      "warmer": {
        "enabled": "true"
      },
      "max_shingle_diff": "3",
      "query_string": {
        "lenient": "false"
      }
    }
  }
}


1.jpg


2.jgp_.jpg


 

sunshine_grand - 90后程序媛

赞同来自:

请问这个问题解决了吗?我也碰到这个问题了

shwtz - 学物理想做演员的IT男

赞同来自:

刚刚自己解决了一个自己遇到的迁移失败的问题,发现是ilm的配置的allocation和index  setting中配置的allocation使用的关键词不同造成的。
 
我在index setting 中使用 includes 关键字:
"index.routing.allocation.include.box": "hot"
 
然后在ilm的cold阶段定义的allocation的关键字是:
"cold": {
        "min_age": "30d",
        "actions": {
          "allocate": {
            "require": {
              "box": "cold"
            }
          }
        }
      }
 
测试使用  _ilm/move来直接进入cold阶段时,发现索引迁移没有动静,显示题目中的信息:
Waiting for [2] shards to be allocated to nodes matching the given filters
 
通过查询此时索引的setting,发现settings中同时包含了include和require两种allocation:
"index.routing.allocation.include.box": "hot",
"index.routing.allocation.require.box": "cold"
 
所以这种情况,索引迁移将无法判断满足条件的节点到底是哪些,所以就处于waiting状态。
 
通过修改ilm的配置,将其中迁移的require改成include之后,调用_ilm/move进入colde阶段,索引分片就可以正常迁移到cold节点了。。
 
 

要回复问题请先登录注册