- 查看es集群狀態(tài)
curl -XGET -uelastic -p http://172.18.35.144:9200/_cat/health?v
cluster ,集群名稱
status,集群狀態(tài) green代表健康;yellow代表分配了所有主分片,但至少缺少一個(gè)副本,此時(shí)集群數(shù)據(jù)仍舊完整;red代表部分主分片不可用,可能已經(jīng)丟失數(shù)據(jù)。
node.total,代表在線的節(jié)點(diǎn)總數(shù)量
node.data,代表在線的數(shù)據(jù)節(jié)點(diǎn)的數(shù)量
shards, active_shards 存活的分片數(shù)量
pri,active_primary_shards 存活的主分片數(shù)量 正常情況下 shards的數(shù)量是pri的兩倍。
relo, relocating_shards 遷移中的分片數(shù)量,正常情況為 0
init, initializing_shards 初始化中的分片數(shù)量 正常情況為 0
unassign, unassigned_shards 未分配的分片 正常情況為 0
pending_tasks,準(zhǔn)備中的任務(wù),任務(wù)指遷移分片等 正常情況為 0
max_task_wait_time,任務(wù)最長(zhǎng)等待時(shí)間
active_shards_percent,正常分片百分比 正常情況為 100%
- 查看es分片信息
curl -XGET -uelastic -p http://172.18.35.144:9200/_cat/shards/test*?v
index:所有名稱
shard:分片數(shù)
prirep:分片類型,p=pri=primary為主分片,r=rep=replicas為復(fù)制分片
state:分片狀態(tài),STARTED為正常分片,INITIALIZING為異常分片
docs:記錄數(shù)
store:存儲(chǔ)大小
ip:es節(jié)點(diǎn)ip
node:es節(jié)點(diǎn)名稱
- 查看es索引
curl -XGET -uelastic -p http://172.18.35.144:9200/_cat/shards |grep UNASSIGNED
查看ES索引文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-518055.html
curl -XGET -uelastic -p http://localhost:9200/_cat/indices?pretty #indices表示索引,是index的復(fù)數(shù).
本文參考:https://www.cnblogs.com/expiator/p/14847705.html文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-518055.html
到了這里,關(guān)于ES命令行查詢es集群的狀態(tài)、分片、索引的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!