ElasticSearch查询操作最大sharding数目限制

本文介绍了ElasticSearch中查询操作的最大sharding数目限制问题及解决办法。当查询涉及的分片超过1000时,将出现错误提示,可通过调整action.search.shard_count.limit参数来提高限制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ElasticSearch查询操作最大sharding数目限制

1. 问题说明

在ES中做一个大范围的查询时,经常会报这个错误:

{
    "error":{
        "root_cause":[
            {
                "type":"illegal_argument_exception",
                "reason":"Trying to query 1230 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."
            }
        ],
        "type":"illegal_argument_exception",
        "reason":"Trying to query 1230 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."
    }
}

主要意思就是说这个查询涉及到的分片太多,超过了限制,可以通过调节这个参数action.search.shard_count.limit来修改这个限制。

2. 参数说明

action.search.shard_count.limit这个参数主要用于限制一次操作过多的分片,防止过多的占用内存和CPU资源。

相关的参数还有这些:
- index.max_result_window:限制一次查询出的数据条数
- TODO

ref

https://discuss.elastic.co/t/too-many-shards/59668

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值