1. 程式人生 > >ElasticSearch的狀態檢視

ElasticSearch的狀態檢視

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