一、常用命令
[wlsadmin@elastic-01~]$ curl -XGET "http://10.219.27.00:7116/_cluster/health?pretty"
{
cluster name":"cluster"
"status": "yellow", #集群状态
"timed out" : false,
"number of nodes": 3, #集群的节点数
"number_of data nodes": 3, #数据节点数
"active_primary_shards" : 8036, #集群中所有活跃的主分片数
"active shards": 16082, #集群中所有活跃的分片数
"relocating shards": 0, #当前节点迁往其他节点的分片数量,通常为0,当有节点加入或者退出时该值会增加。
"initializing shards": 0, #正在初始化的分片
"unassigned shards": 10, #未分配的分片数,通常为0,当有某个节点的副本分片丢失该值就会增加。
"delayed unassigned shards": 0,
"number of pending tasks": 0, 是指主节点创建索引并分配shards等任务,如果该指标数值一直未减小代表集群存在不稳定因素
"number of in flight fetch" :0,
"task max waiting in queue millis": 0,
"active shards percent as number" :99.93785732040766 #集群分片健康度,活跃分片数占总分片数比例。
}
说明:pending task只能由主节点来进行处理,这些任务包括创建索引并将shards分配给节点。
#2.集群状态信息
[wlsadmin@elastic-01~]$ curl -XGET "http://10.219.27.00:7116/_cluster/stats?pretty"
{
"_nodes":{
"total":3,
"successful":3,
"failed":0
},
"cluster name":"cluster"
"timestamp": 1650958054278,
"status": "yellow",
"indices":{
"count”:1612,
"shards":{
"total”:16082, #分片总数
"primaries”:8036,
"replication”: 1.001244400199104
"index":{
"shards":{
"min": 2,
"max”:15,
"avg”: 9.97642679900744
},
"docs”:{
"count”: 6917866009, #文档总数
"deleted": 16940
},
"store":{
"size in bytes”:7722541162072
"throttle time in millis": 0
},
"fielddata”:{
"memory_size_in_bytes": 2400,
"evictions”:0},
"segments”:{
"count”:182641,