【问题标题】:Elasticsearch shard relocation not workingElasticsearch 分片重定位不起作用
【发布时间】:2015-09-21 18:25:39
【问题描述】:

我在现有的 8 个数据节点集群中添加了 12 个新数据节点。我正在尝试按照建议使用“排除分配”关闭前 8 个节点

curl -XPUT localhost:9200/_cluster/settings -d '{ “短暂的” : { “cluster.routing.allocation.exclude._ip”:“10.0.0.1” } }'

它没有重新定位任何分片,所以我运行了带有“解释”选项的重新路由命令。有人能解释一下下面的文字是什么意思吗?

>  "explanations" : [ {
>     "command" : "move",
>     "parameters" : {
>       "index" : "2015-09-20",
>       "shard" : 0,
>       "from_node" : "_dDn1SmqSquhMGgjti6vGg",
>       "to_node" : "OQBFMt17RaWboOzMnUy2jA"
>     },
>     "decisions" : [ {
>       "decider" : "same_shard",
>       "decision" : "YES",
>       "explanation" : "shard is not allocated to same node or host"
>     }, {
>       "decider" : "filter",
>       "decision" : "YES",
>       "explanation" : "node passes include/exclude/require filters"
>     }, {
>       "decider" : "replica_after_primary_active",
>       "decision" : "YES",
>       "explanation" : "shard is primary"
>     }, {
>       "decider" : "throttling",
>       "decision" : "YES",
>       "explanation" : "below shard recovery limit of [16]"
>     }, {
>       "decider" : "enable",
>       "decision" : "YES",
>       "explanation" : "allocation disabling is ignored"
>     }, {
>       "decider" : "disable",
>       "decision" : "YES",
>       "explanation" : "allocation disabling is ignored"
>     }, {
>       "decider" : "awareness",
>       "decision" : "NO",
>       "explanation" : "too many shards on nodes for attribute: [dc]"  }, {
>       "decider" : "shards_limit",
>       "decision" : "YES",
>       "explanation" : "total shard limit disabled: [-1] <= 0"
>     }, {
>       "decider" : "node_version",
>       "decision" : "YES",
>       "explanation" : "target node version [1.4.5] is same or newer than source node version [1.4.5]"
>     }, {
>       "decider" : "disk_threshold",
>       "decision" : "YES",
>       "explanation" : "enough disk for shard on node, free: [1.4tb]"
>     }, {
>       "decider" : "snapshot_in_progress",
>       "decision" : "YES", "explanation" : "no snapshots are currently running"
>     

【问题讨论】:

    标签: elasticsearch


    【解决方案1】:

    如果你有副本,你可以简单地关闭你的节点,一个一个地等待集群再次变绿。

    在这种情况下,您不需要明确地重新路由。

    也就是说,在您的日志中,听起来您在 elasticsearch.yml 文件中使用了 awareness。你应该检查你的设置。

    【讨论】:

    • 谢谢,马上去试试。是否有一些公式可以确定可以在固定数量的节点上分配多少个索引(具有固定数量的分片)?
    • 这是一个完全不同的问题。答案实际上取决于用例。对于热索引,经验法则是每个核心拥有一个分片。因此,如果您有 3*8 核机器,您可以尝试分配 12 个主分片 + 每个主分片 1 个副本。
    【解决方案2】:

    您可以安装kopf插件,它将帮助您管理elasticsearch节点,并且任务将更加简化。

    有了这个插件,你想要的就更简单了。

    您可以在这里下载:https://github.com/lmenezes/elasticsearch-kopf

    其他支持你的插件可以在:https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-plugins.html .

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多