官网地址:cat indices | Elasticsearch Reference [5.5] | Elastic
cat indices
indices命令提供了每个索引的横截面(cross-section)。这个信息跨节点。例如:
GET /_cat/indices/twi*?v&s=index
返回:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open twitter u8FNjxh8Rfy_awN11oDKYQ 1 1 1200 0 88.1kb 88.1kb
green open twitter2 nYFWZEO7TUiOjLQXBaYJpA 5 0 0 0 260b 260b
我们可以快速地确定一个索引有多少碎片构成、文档的数量、删除的文档、主存储大小和总存储大小(所有的碎片包括副本)。所有这些公开的指标都直接来自Lucene api。
注意(note):
1、正如在lucene级别中显示的文档和删除文档的数量一样,它也包括所有隐藏的文档(例如来自嵌套文档)。
2、要获得Elasticsearch级别的文档的实际计数,建议的方法是使用cat count或count API。
primaries
默认的索引属性将显示所有索引的碎片,包括副本。可以提供一个{pri}标志,以便在只有primaries的有关的统计数据。
example
哪些索引的状态是yellow?
GET /_cat/indices?v&health=yellow
返回结果:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open twitter u8FNjxh8Rfy_awN11oDKYQ 1 1 1200 0 88.1kb 88.1kb
哪种索引最多的文档?
GET /_cat/indices?v&s=docs.count:desc
返回结果:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open twitter u8FNjxh8Rfy_awN11oDKYQ 1 1 1200 0 88.1kb 88.1kb
green open twitter2 nYFWZEO7TUiOjLQXBaYJpA 5 0 0 0 260b 260b
twitter完成了多少合并操作?
GET /_cat/indices/twitter?pri&v&h=health,index,pri,rep,docs.count,mt
返回:
health index pri rep docs.count mt pri.mt
yellow twitter 1 1 1200 16 16
每个索引使用多少内存?
GET /_cat/indices?v&h=i,tm&s=tm:desc
返回结果:
i tm
twitter 8.1gb
twitter2 30.5kb
网友评论