ES 创建索引报错 maximum shards open

问题描述

创建索引时,报错显示this action would add [2] total shards, but this cluster currently has [1000]/[1000] maximum shards open。

问题原因

由于节点shard数量超过最大值限制,ES默认每个节点的shard数量是1000,如果shard数量超过这个值创建索引会报错。

解决方案

  1. 关闭或者删除不用的索引,减少shard数量。

  2. 修改节点的shard数量的限制,这里设置 3000。

    PUT _cluster/settings
    {
      "persistent": {
        "cluster": {
        "max_shards_per_node": 2000
        }
      }
    }

或者

curl -X PUT localhost:9200/_cluster/settings -H "Content-Type: application/json" -d '{ "persistent": { "cluster.max_shards_per_node": "3000" } }'

文章参考

CSS创建索引报错maximum shards open_云搜索服务 CSS_故障排除_功能使用类 (huaweicloud.com)

Last updated