gpt4 book ai didi

elasticsearch - 如何在Elasticsearch 6.3中找到哪个碎片超过30Gb

转载 作者:行者123 更新时间:2023-12-02 22:48:13 26 4
gpt4 key购买 nike

我想知道是否可以运行DSL查询来获取超过一定大小的碎片列表?

_cat / shards列出了所有它们,但是我们有成千上万个shard,甚至将它们全部导出到Excel,并且尝试按值进行筛选也很困难。

我们可以指定一个查询来提取大于30Gb的碎片吗?

最佳答案

您可以显示所有碎片并按大小对其进行排序。根据documentation:

Each of the commands accepts a query string parameter s which sorts the table by the columns specified as the parameter value. Columns are specified either by name or by alias, and are provided as a comma separated string. By default, sorting is done in ascending fashion. Appending :desc to a column will invert the ordering for that column. :asc is also accepted but exhibits the same behavior as the default sort order.



因此,您可以按以下大小按降序列出所有碎片:
GET _cat/shards?v&s=store:desc
v用于 verbose commands用于 sort query stringstore是包含分片大小的列的名称, :desc用于按降序排序。

所有大于30Gb的碎片将首先出现。

关于elasticsearch - 如何在Elasticsearch 6.3中找到哪个碎片超过30Gb,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54189319/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com