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

标签 elasticsearch querydsl

我想知道是否可以运行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/

相关文章:

spring - 使用 Spring Data JPA 中的规范进行内连接和分组

java - 如何在外部实体上生成 query-dsl Q 类?

java - QueryDSL 继承 : subtype in where clause

java - 使用 Spring JPA 或 QueryDSL 进行动态搜索词 SQL 查询

elasticsearch - 如何使用Elasticsearch Java RestHighLevelClient API创建 bool 查询

elasticsearch - Elasticsearch 的 Hunspell 字典放在哪里

php - 像ElasticSearch中的查询

elasticsearch - 如何根据相关性对 Elastic Search 查询结果进行排序?

mysql - 如何实时迁移mysql数据到ElasticSearch

java - Spring Boot 上的 QueryDSL 问题