Elasticsearch(es)查看集群所有索引情况可以使用 cat API 查看。
命令
可以在终端执行 curl 命令或在 es 工具上执行 get 请求(如 kibana 的 dev tools)。
终端命令
curl -XGET 'localhost:9200/_cat/indices?v&pretty'
Kibana Dev Tools 上执行
GET _cat/indices?v&pretty
返回信息如下:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open qa jCHwgQn0QX2tM2dA9dJi8w 8 2 211572 53 3.3gb 1.1gb
......
返回信息的第一行对应的每一列字段意义如下:
health
当前健康状态
status
开启/关闭(open/close)状态
index
索引名称
uuid
索引 uuid
pri
主分片数目
rep
副本分片数目
docs.count
可用的文档数目
docs.deleted
已删除的文档数目
store.size
主分片和副本分片的存储文档空间大小
pri.store.size
主分片的存储文档空间大小
关于列字段的更多内容,也可以通过增加 help 参数进行查看。
GET _cat/indices?help
输出如下:
health | h | current health status
status | s | open/close status
index | i,idx | index name
uuid | id,uuid | index uuid
pri | p,shards.primary,shardsPrimary | number of primary shards
rep | r,shards.replica,shardsReplica | number of replica shards
docs.count | dc,docsCount | available docs
docs.deleted | dd,docsDeleted | deleted docs
creation.date | cd | index creation date (millisecond value)
creation.date.string | cds | index creation date (as string)
store.size | ss,storeSize | store size of primaries & replicas
pri.store.size | | store size of primaries
completion.size | cs,completionSize | size of completion
pri.completion.size | | size of completion
fielddata.memory_size | fm,fielddataMemory | used fielddata cache
pri.fieldda