ES调整最大分片数:but this cluster currently has maximum shards open

 

ES最大分片数默认每个节点是一千,如有三个节点 默认就是三千 但是这个并不够 

超过就会报错

{ "error": { "root_cause": [ { "type": "validation_exception", "reason": "Validation Failed: 1: this action would add [5] total shards, but this cluster currently has [2995]/[3000] maximum shards open;" } ] } }

 

 

具体可以通过dsl语句查询

GET /_cluster/settings?include_defaults=true

然后查看对应的

"persistent" : {
    "cluster" : {
      "max_shards_per_node" : "1000"
    }
  }

以上就表示每个节点一千

 

调整持久化设置最大分片数 每个节点两千

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

 

posted @ 2025-11-04 10:59  yvioo  阅读(5)  评论(0)    收藏  举报