_cat系列命令
_cat系列命令提供了一系列查询elasticsearch集群状态的接口。你可以通过执行下面请求,获取所有_cat系列操作
curl -XGET localhost:9200/_cat
=^.^=
/_cat/allocation
/_cat/shards
/_cat/shards/{
index}
/_cat/master
/_cat/nodes
/_cat/indices
/_cat/indices/{
index}
/_cat/segments
/_cat/segments/{
index}
/_cat/count
/_cat/count/{
index}
/_cat/recovery
/_cat/recovery/{
index}
/_cat/health
/_cat/pending_tasks
/_cat/aliases
/_cat/aliases/{
alias}
/_cat/thread_pool
/_cat/plugins
/_cat/fielddata
/_cat/fielddata/{
fields}
可以通过在命令后面加 ?v的方式打印表头,如
curl -XGET 127.0.0.1:9200/_cat/master?v
返回:
id host ip node
iBophuJTRdiZAZ7hWKWBeA 127.0.0.1 127.0.0.1 node-1
_cluster系列
1、查询设置集群状态
curl -XGET localhost:9200/_cluster/health?pretty=true
#pretty=true表示格式化输出
#level=indices 表示显示索引状态
#level=shards 表示显示分片信息
2、显示集群系统信息,包括CPU JVM等等
curl -XGET localhost:9200/_cluster/stats?pretty=true
3、集群的详细信息。包括节点、分片等。
curl -XGET localhost:9200/_cluster/state?pretty=true
4、获取集群堆积的任务
curl -XGE