目 录CONTENT

文章目录
ELK

解决ElasticSearch的maximum shards open问题

乔克
2022-03-05 / 0 评论 / 1 点赞 / 1,985 阅读 / 758 字 / 正在检测是否收录...
温馨提示:
本文最后更新于 2022-03-05,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。
广告 广告

问题

ValidationException[Validation Failed: 1: this action would add [2] total shards, but this cluster currently has [999]/[1000] maximum shards open;]

原因

这是因为集群最大shard(分片)数不足引起的,从Elasticsearch v7.0 开始,集群中的每个节点默认限制1000个分片。

解决

方案1、在elasticsearch.yml中定义

cluster.max_shards_per_node: 10000

方案2、在kibana控制台执行

PUT /_cluster/settings
{
  "transient": {
    "cluster": {
      "max_shards_per_node":10000
    }
  }
}

方案3、在linux控制台执行

curl -XPUT http://localhost:9200/_cluster/settings \
-u elastic:password \
-H "Content-Type: application/json" \
-d '{"transient":{"cluster":{"max_shards_per_node":10000}}}' 

返回{"acknowledged":true,"persistent":{},"transient":{"cluster":{"max_shards_per_node":"10000"}}}表示执行成功!

1

评论区