1.1 基本状态查看
集群状态
| get _cluster/health get _cluster/state get _cluster/settings get _cluster/pending_tasks 注: get _cluster/health查看分片状态 get _cluster/state查看nodes,metadata, indices信息 |
节点状态
| get _cat/nodes?v #查看ip|heap.percent|ram.percent |load_1m|load_5m|load_15m |node.role |master |name get _nodes get _nodes/stats #这两条命令相同 #主要角色 "roles": [ "master", "data", "ingest" ], get _nodes/hot_threads get _nodes/node-1/hot_threads ::: {node-1}{BxHQfpeBRPq4CLOk61bOIQ}{-EzwOWxpTwyoekXMsssNIw}{192.168.11.73}{192.168.11.73:9300} Hot threads at 2017-11-16T05:14:55.330Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true: 10.3% (51.3ms out of 500ms) cpu usage by thread 'elasticsearch[node-1][bulk][T#2]' 9/10 snapshots sharing following 2 elements 3.5% (17.5ms out of 500ms) cpu usage by thread 'elasticsearch[node-1][refresh][T#1]' 10/10 snapshots sharing following 2 elements |
索引状态
| GET _cat/indices?v GET _all?pretty GET _all/_stats #健康状态 GET _cluster/health?pretty&level=indices |
查看单个索引状态
| get risklog-2017.11.10/_stats get risklog-2017.11.10/_count #查看mapping逻辑结构 get risklog-2017.11.10/_mapping #查看物理结构 get risklog-2017.11.10/_search_shards get risklog-2017.11.10/_segments |
分片状态
| GET _cat/shards?help GET_cat/shards?v&h=index,shard,state,docs,store,ip,unassigned.reason,unassigned.details |
1.2巡检脚本
健康状态
| GET _cluster/health GET _cluster/health?level=indices GET _cluster/health?level=shards GET _cluster/health?wait_for_status=green |
磁盘空间容量
| GET _cat/allocation?help GET _cat/allocation?v |
1.3分片恢复
1.3.1 待验证
logstash-2017.08.03/_recovery?human
logstash-2017.08.03/_recovery?human&pretty
logstash-2017.08.03/_stats?pretty
logstash-2017.08.03/_shard_stores?pretty
logstash-2017.08.03/_shard_stores?status=green&pretty
官网原话: 1、Allocate an unassigned shard to a node. Accepts the index and shardfor index name and shard number, and node to allocate the shard to. It alsoaccepts allow_primary flag to explicitly specify that it is allowed toexplicitly allocate a primary shard (might result in data loss).
2、Warning:Theallow_primary parameter will force a new empty primary shard to beallocatedwithout any data. If a node which has a copy of the original shard(including data) rejoins the cluster later on, that data will be deleted: theold shard copy will be replaced by the new live shard copy.
1.4 CAT api
| GET _cat GET /_cat/indices?help GET _cat/indices?v&bytes=gb?v |
支持原创
原文,公众号:clark_blog 博客:blog.csdn.net/clark_xu
代码:https://github.com/clark99 |