相关API

作者: 会飞的鱼Coo | 来源:发表于2017-11-03 09:44 被阅读33次

allocation指令:

该指令提供一个快照,反映当前节点有多少个分片(shard)以及用了多少磁盘空间(disk)。

curl http://localhost:9200/_cat/allocation?v

#获取当前系统有多少个index

curl http://10.90.7.2:9201/_cat/indices?v

#获取当前集群中有多少个document

curl http://10.90.7.2:9201/_cat/count?v

#获取tksearch这个index的document数量

curl http://10.90.7.2:9201/_cat/count/tksearch?v

health指令:该指令反应当前集群的健康指数信息。

curl http://localhost:9200/_cat/health?v

node指令:该指令反应出当前集群的拓扑信息。

curl http://10.130.203.111:9200/_cat/nodes?v

pending_tasks指令:

该指令反应当前集群有多少任务处在pending状态,与指令/_cluster/pending_tasks的效果一样。

curl http://localhost:9200/_cat/pending_tasks?v

recovery指令:

该指令反应当前系统中,索引分片的恢复信息,包括正在进行的以及已经完成了的。恢复,指的是当节点添加或者减少时发生的数据移动造成的。

curl http://localhost:9200/_cat/recovery?v

shards指令:

该指令,相对比较重要,反应每个节点有那些分片,告诉我们,那些是主分片,那些是从分片,每个分片的document数量,以及在该节点占用的磁盘空间。

curl http://localhost:9200/_cat/shards?v

segments指令

该指令反应的是在当前index中的某个shard的segment的信息,属于相对底层的信息。

curl http://localhost:9200/_cat/segments?v


查询集群健康状态:

http://192.168.0.163:9200/_cluster/health?pretty=true

安装x-pack后访问head:

http://192.168.0.164:9100/?auth_user=elastic&auth_password=changeme

删除索引下type下的所有数据:

curl -XPOST 192.168.0.162:9200/index_xxx/type_xxxx/_delete_by_query?conflicts=proceed -d'

{

"query": {

"match_all": {}

}

}'

修改副本数:

curl -XPUT http://192.168.60.211:9200/webids_log/_settings -d'

{

"index" : {

"number_of_replicas" : 0

}

}'

相关文章

网友评论

      本文标题:相关API

      本文链接:https://www.haomeiwen.com/subject/cygzpxtx.html