ElasticSearch--解决this action would add [5] total shards, but this cluster currently has [1000]/[1000
原文网址:ElasticSearch--解决this action would add [5] total shards, but this cluster currently has [1000]/[1000_IT利刃出鞘的博客-CSDN博客
简介
本文介绍ElasticSearch总分片数量导致的异常的解决方案。
异常的日志为:this action would add [5] total shards, but this cluster currently has [1000]/[1000
技术资料与交流 ==> 分享靠谱资料:Java真实面试题汇总、精选简历模板、PDF书籍(高清带书签)、精选PPT模板等;分享Java实用技术;帮助优化简历。详见:资料与交流
问题描述
项目里SkyWalking使用ES来存数据,但今天我查看日志时没有今天的数据,只有昨天的,于是我查看SkyWalking的日志(logs/skywalking-oap-server.log),发现如下结果:
[4532]: index [sw_segment-20211201], type [_doc], id [1c8b09ece71a45bd8de74e27a74a6bf6.167.16383242084776012], message [ElasticsearchException[Elasticsearch exception [type=validation_exception, reason=Validation Failed: 1: this action would add [5] total shards, but this cluster currently has [1000]/[1000] maximum shards open;]]]
[4533]: index [sw_log-20211201], type [_doc], id [34a07ac188a8433e865a3bbabb74673a], message [ElasticsearchException[Elasticsearch exception [type=validation_exception, reason=Validation Failed: 1: this action would add [5] total shards, but this cluster currently has [1000]/[1000] maximum shards open;]]]
[4534]: index [sw_segment-20211201], type [_doc], id [1c8b09ece71a45bd8de74e27a74a6bf6.167.16383242085016022], message [ElasticsearchException[Elasticsearch exception [type=validation_exception, reason=Validation Failed: 1: this action would add [5] total shards, but this cluster currently has [1000]/[1000] maximum shards open;]]]
[4535]: index [sw_segment-20211201], type [_doc], id [1c8b09ece71a45bd8de74e27a74a6bf6.167.16383242085336030], message [ElasticsearchException[Elasticsearch exception [type=validation_exception, reason=Validation Failed: 1: this action would add [5] total shards, but this cluster currently has [1000]/[1000] maximum shards open;]]]
[4536]: index [sw_segment-20211201], type [_doc], id [1c8b09ece71a45bd8de74e27a74a6bf6.167.16383242085436040], message [ElasticsearchException[Elasticsearch exception [type=validation_exception, reason=Validation Failed: 1: this action would add [5] total shards, but this cluster currently has [1000]/[1000] maximum shards open;]]]
其异常信息都是:this action would add [5] total shards, but this cluster currently has [1000]/[1000] maximum shards open;
原因分析
ES7.x默认总分片只有1000个,目前已经用完了,导致已经没法创建新的索引了。
解决方案
解决方法就是提高ES的分片数量。
方法1:控制台
PUT /_cluster/settings
{"persistent": {"cluster": {"max_shards_per_node":10000}}
}
persistent:永久生效,transient:临时生效。
方法2:CURL命令
curl --location --request PUT 'http://127.0.0.1:9200/_cluster/settings' \
--header 'Content-Type: application/json' \
--data '{"persistent":{"cluster":{"max_shards_per_node":10000}}}'
persistent:永久生效,transient:临时生效。
其他方法
有人说可以修改配置文件(elasticsearch.yml),添加下边一行
cluster.max_shards_per_node: 10000
但我测试发现 ,没有生效。我通过GET /_cluster/settings?pretty查看,返回结果如下:
{"persistent": {},"transient": {}
}
我的ES版本为:7.15.0
查看是否生效
GET /_cluster/settings?pretty
结果
{"persistent": {"cluster": {"max_shards_per_node": "10000"}},"transient": {}
}
其他网址
this cluster currently has [1946]/[1000] maximum shards open_luoqinglong的专栏-CSDN博客
ElasticSearch--解决this action would add [5] total shards, but this cluster currently has [1000]/[1000相关推荐
- es Failed: 1: this action would add [2] total shards, but this cluster currently has [1001]/[1000]
你用的7版本以上的elasticsearch吧,默认只允许1000个分片,问题是因为集群分片数不足引起的. 现在在elasticsearch.yml中定义 PUT /_cluster/settings ...
- ES报错this action would add [2] total shards, but this cluster currently has [5000]/[5000] maximum sha
文章目录 版本es742,在使用logstash写索引的时候,突然发现logstash日志在报错 报错信息: [2020-06-17T12:01:18,241][WARN ][logstash.out ...
- elasticsearch解决控制台中文乱码问题
elasticsearch解决控制台中文乱码问题 参考文章: (1)elasticsearch解决控制台中文乱码问题 (2)https://www.cnblogs.com/chenmz1995/p/1 ...
- 成功解决ValueError: Unable to add relationship because child variable ‘ID‘ in ‘cats_df‘ is also its inde
成功解决ValueError: Unable to add relationship because child variable 'ID' in 'cats_df' is also its inde ...
- 面试精讲之面试考点及大厂真题 - 分布式专栏 17 ElasticSearch解决大数据量检索难题
17 ElasticSearch解决大数据量检索难题 理想的书籍是智慧的钥匙. --列夫·托尔斯泰 引言 如果你的项目里有超过千万上亿级别的数据,且数据日增量较大需要高性能检索时,如订单数据,你该怎么 ...
- Elasticsearch解决只能查询10000条数据以及查询的total为10000条的解决方案
Elasticsearch官方默认限制索引查询最多只能查询10000条数据,查询第10001条数据开始就会报错: Result window is too large, from + size mus ...
- elasticsearch解决同步删除数据库中不存在的数据
摘要: jdbc-input-plugin 只能实现数据库的追加,对于 elasticsearch 增量写入,但经常jdbc源一端的数据库可能会做数据库删除或者更新操作.这样一来数据库与搜索引擎的数据 ...
- 分布式 - ElasticSearch解决大数据量检索难题
不啰嗦,我们直接开始! 引言 如果你的项目里有超过千万上亿级别的数据,且数据日增量较大需要高性能检索时,如订单数据,你该怎么办? 作为面试官,你需要找一个能解决这个问题的人!为应聘者,你该如何回答面试 ...
- ElasticSearch解决去重精度问题 scripted_metric 去重计数脚本计算高效率解决问题(二)
ElasticSearch scripted_metric 去重计数脚本计算高效率解决问题(二) 11月12日解决问题记录 计数后排序问题暂未解决 话不多说直接贴代码 : init_script 定义 ...
最新文章
- events.out.tfevents文件
- RabbitMQ安装
- Windows网络通信(二):socket异步编程
- 远程桌面网关Apache Guacamole 发布1.0.0版本\n
- Color the ball
- 树莓派摄像头基本操作
- Leecode19. 删除链表的倒数第 N 个结点——Leecode大厂热题100道系列
- dubbo源码解析-服务暴露原理
- 2022,微博稳了吗?
- Java 构造函数的详解
- 计算机考研复试-计算机组成原理
- 解决小米10上 Google Play 卡在正在等待下载,以及从服务器检索信息时出错。DF-DFERH-01的问题
- flask爱家租房项目开发(一)
- iOS 火星坐标相关整理及解决方案汇总
- edge怎么开启沉浸式阅读_美人鼓上舞!端午小长假,豫园将开启史上首次沉浸式国风庙会...
- BNET创始人刘建军:BNET破解当今通信网络三大痛点
- 好听的歌曲,更新记录听过的音乐。。
- 如何查看谷歌网页端保存的密码以及查看xshell连接中的密码
- python 基于模板生成ppt_python生成ppt的方法
- 愿你千帆历尽归来仍是少年!