es的接口说明

_cat接口:

接口格式:node

curl -XGET http://localhost:9200/_cat/$command

若是只想查看某个索引库的信息,在后面再加上库名便可:json

curl -XGET http://localhost:9200/_cat/$command/$indexname

例如查看文档数量:bash

curl -XGET http://localhost:9200/_cat/count

只查看某个索引库文档数量:curl

curl -XGET http://localhost:9200/_cat/count/$indexname

查看全部支持的命令url

curl -XGET http://localhost:9200/_cat

打开verbose:

curl -XGET http://localhost:9200/_cat/$command?v

查看输出结果列的说明:spa

curl -XGET http://localhost:9200/_cat/$command?help

只输出指定的列:插件

curl -XGET http://localhost:9200/_cat/$command?h=ip,port,name

各种数字格式指定:默认会输出可读格式,能够强制使用数字格式方便排序:线程

curl 'http://localhost:9200/_cat/indices?bytes=b

支持三种数字格式的指定,时间格式用: time,数字格式用:size,字节格式用:bytescode

输出格式指定:orm

curl 'localhost:9200/_cat/indices?format=json&pretty'

格式能够是这几种:- text (default) - json - smile - yaml - cbor

排序:

curl 'localhost:9200/_cat/indices?v&s=order:desc,index_patterns'

各种cat支持的命令列表:

aliases:索引库的别名

allocation:每一个节点上建立的索引库数量及占用的磁盘空间

count:文档数量

fielddata:每一个节点上使用的堆内存状况

health:当前状态

indices:索引库信息

master:主节点的节点id,ip和节点名

nodeattrs:显示节点的处定义属性

nodes:显示当前集群的拓扑结构

pending_tasks:还未执行完的任务列表

plugins:每一个节点运行的插件信息

recovery:索引分片的恢复信息,包括正在恢复和已经恢复好的分片

repositories:集群里注册的仓库快照

thread_pool:集群里每一个节点的线程池统计信息

shard:每一个节点上的分片的信息

segments:分片底层索引分段的信息

snapshots:显示某个指定仓库的全部快照信息,必须指定仓库,如:

GET /_cat/snapshots/repo1?v&s=id

templates:显示已存在的模板信息

 

cluster接口:

集群健康状况:

GET _cluster/health?pretty=true

集群状态:

GET /_cluster/state?pretty=true

集群统计信息:

GET /_cluster/stats?human&pretty

集群中还未完成的任务:

GET /_cluster/pending_tasks

移动某个分片到指定的节点:

POST /_cluster/reroute

更新集群的设置:

PUT /_cluster/settings

查看集群设置:

GET /_cluster/settings

查看各节点的统计信息:

GET /_nodes/stats
GET /_nodes/nodeId1,nodeId2/stats

查看节点信息:

GET /_nodes
GET /_nodes/nodeId1,nodeId2

查看各节点的使用状况:

GET _nodes/usage
GET _nodes/nodeId1,nodeId2/usage
相关文章
相关标签/搜索