Elasticsearch 超出分片1000,无法写入

Elasticsearch 超出分片1000,无法写入,第1张

Elasticsearch 超出分片1000,无法写入

现象: es 日志出现:

[2021-12-15T07:45:10,517][WARN ][o.e.x.m.e.l.LocalExporter] [node-1] unexpected error while indexing monitoring document
org.elasticsearch.xpack.monitoring.exporter.ExportException: org.elasticsearch.common.ValidationException: Validation Failed: 1: this action would add [1] total shards, but this cluster currently has [1053]/[1000] maximum shards open;

显示分片打开超过1000 的分片

分析: Elasticsearch 7.x 默认 cluster.max_shards_per_node 为 1000

*** 作:

调整分片为每个节点的分片为10000

#通过API 进行修改

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

transient 临时
persistent 永久

总结:

        对于一些ES 只有一台主机,最好开始根据业务情况进行调整每个节点的分片数。在配置文件配置为

cluster.max_shards_per_node: 10000  

启动后验证一下:

GET /_cluster/settings

*** 作后都需要验证一下。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5690337.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存