Elasticsearch报错action.search.shard_count.limit

电玩女神 2023-06-25 10:13 96阅读 0赞

查ES报错

action.search.shard_count.limit

这个参数主要用于限制一次操作过多的分片,防止过多的占用内存和CPU资源。默认情况下ES不限制搜索请求牵涉到的分片数量,你可以设置软限制 action.search.shard_count.limit 来拒绝命中太多分片的请求。

如果看到错误日志如下,修改此参数可以解决问题。

“reason” : “Trying to query 1344 shards, which is over the limit of 1000. This limit exists because querying
many shards at the same time can make the job of the coordinating node very CPU and/or memory
intensive. It is usually a better idea to have a smaller number of larger shards. Update
[action.search.shard_count.limit] to a greater value if you really want to query that many shards at the same time.”

解决方法:
curl -u es:es -XPUT ‘http://localhost:9200/\_cluster/settings‘ -H ‘Content-Type: application/json’ -d’
{
“persistent” : {
“action.search.shard_count.limit” : “2000”
}

发表评论

表情:
评论列表 (有 0 条评论,96人围观)

还没有评论,来说两句吧...

相关阅读