ES创建index报错cluster currently has 4/2 maximum shard

ES创建index报错cluster currently has 4/2 maximum shard

原创

无锋剑客©著作权

文章标签 数据 elasticsearch 解决方案 文章分类 Hadoop 大数据

©著作权归作者所有:来自51CTO博客作者无锋剑客的原创作品,请联系作者获取转载授权,否则将追究法律责任

前提

调试业务服务期间,服务日志需要写入es集群,发现数据写入报错。

报错内容如下

ElasticsearchDeprecationWarning: In a future major version, this request will fail because this action would add [10] total shards, but this cluster currently has [20242]/[20000] maximum shards open. Before upgrading, reduce the number of shards in your cluster or adjust the cluster setting [cluster.max_shards_per_node].

报错内容分析

根据报错内容描述可以看出,是es集群分片数量达到上限导致报错。

解决办法有以下几种:

1:删除集群无用index,减少集群分片数量;2:修改集群index 默认数量,或者修改现有index分片数量;3:修改集群分片数量上限;

调整集群最大分片数

这一次采取了临时快速解决方案,解决方案如下:

[En]

This time, a temporary quick solution is adopted, and the solutions are as follows:

查看现在集群分片数

以下操作在kibana devtool 空间操作

GET _cluster/stats?filter_path=*indices*{  "indices" : {    "count" : 1740,    "shards" : {      "total" : 20242,     <<<<<

修改集群最大分片数

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

结论:

以上操作完成,可以快速应对集群创建index 报分片数量过多问题。另外es集群分片数量设置是否合理,需要参考集群节点数量,数据量、节点内存大小等信息,不在本文阐述。

  • 打赏
  • 收藏
  • 评论
  • *举报

上一篇:开源BI平台软件特性对比

下一篇:分布式调度系统-DolphinScheduler

Original: https://blog.51cto.com/michaelkang/5580749
Author: 无锋剑客
Title: ES创建index报错cluster currently has 4/2 maximum shard

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/508495/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球