ElasticSearch 状态查询Cat接口
所属分类 elasticsearch
浏览量 1104
/_cat
/_cat/allocation # 查看单节点的shard分配情况
/_cat/shards # 查看各shard的详细情况
/_cat/shards/{index} # 查看指定分片的详细情况
/_cat/master # 查看master节点信息
/_cat/nodes # 查看所有节点信息
/_cat/indices # 查看所有index的详细信息
/_cat/indices/{index} # 查看指定index的详细信息
/_cat/segments # 查看各index的segment详细信息,包括segment名, 所属shard, 内存(磁盘)占用大小, 是否刷盘
/_cat/segments/{index}# 查看指定index的segment详细信息
/_cat/count # 查看当前集群的doc数量
/_cat/count/{index} # 查看指定索引的doc数量
/_cat/recovery # 查看集群内每个shard的recovery过程
/_cat/recovery/{index}# 查看指定索引shard的recovery过程
/_cat/health # 集群当前状态:红、黄、绿
/_cat/pending_tasks # 查看集群的pending task
/_cat/aliases # 查看所有alias信息,路由配置等
/_cat/aliases/{alias} # 查看指定索引的alias信息
/_cat/thread_pool # 查看集群各节点内部不同类型的threadpool的统计信息
/_cat/plugins # 查看集群各个节点上的plugin信息
/_cat/fielddata # 查看当前集群各个节点的fielddata内存使用情况
/_cat/fielddata/{fields} # 查看指定field的内存使用情况
/_cat/nodeattrs # 查看单节点的自定义属性
/_cat/repositories # 注册快照存储库
/_cat/templates # 模板信息
v参数 显示表头
节点信息
/_cat/nodes?v
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
xx.xx.xx.xx 31 31 0 0.16 0.15 0.09 mdi - esnode3
xx.xx.xx.xx 44 31 0 0.16 0.15 0.09 mdi * esnode1
xx.xx.xx.xx 31 31 0 0.16 0.15 0.09 mdi - esnode2
top -p 2532833,2533097,2533408
top - 09:07:34 up 350 days, 18:47, 3 users, load average: 0.15, 0.14, 0.10
Tasks: 3 total, 0 running, 3 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.2 us, 0.1 sy, 0.0 ni, 99.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 26353670+total, 18188374+free, 69879832 used, 11773140 buff/cache
KiB Swap: 0 total, 0 free, 0 used. 18404155+avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2532833 admin 20 0 20.1g 2.7g 16604 S 0.7 1.1 16:01.27 java
2533097 admin 20 0 16.0g 2.6g 16520 S 0.3 1.0 10:25.33 java
2533408 admin 20 0 15.1g 2.6g 16512 S 0.3 1.1 10:02.77 java
free -h
total used free shared buff/cache available
Mem: 251G 66G 173G 3.9G 11G 175G
Swap: 0B 0B 0B
heap.percent ram.percent 数据感觉不太对
分片信息
/_cat/shards?v
index shard prirep state docs store ip node
bank 3 r STARTED 200 128.1kb xx.xx.xx.xx esnode3
bank 3 p STARTED 200 128.1kb xx.xx.xx.xx esnode1
bank 1 p STARTED 191 122.8kb xx.xx.xx.xx esnode1
bank 1 r STARTED 191 122.8kb xx.xx.xx.xx esnode2
bank 4 p STARTED 201 128.8kb xx.xx.xx.xx esnode3
bank 4 r STARTED 201 128.8kb xx.xx.xx.xx esnode2
bank 2 r STARTED 211 134.4kb xx.xx.xx.xx esnode1
bank 2 p STARTED 211 134.4kb xx.xx.xx.xx esnode2
bank 0 r STARTED 196 125.9kb xx.xx.xx.xx esnode3
bank 0 p STARTED 196 125.9kb xx.xx.xx.xx esnode1
index 索引名
shard 分片序号
prirep p 主分片, r 复制分片
store 分片占用存储空间
node 节点名
docs 文档数
索引信息
/_cat/indices?v
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
green open pets ai5NF914RV6d20O1Ef2z8g 5 1 1 0 8.6kb 4.3kb
green open bank UFz7EVmqS4m72H3IUDxcBA 5 1 999 0 1.2mb 640.2kb
green open blogs v_s4imPNQbKem1gThEMvHA 5 1 2 0 14.9kb 7.4kb
health 索引的健康状态
index 索引名
pri 索引主分片数量
rep 索引复制分片数
store.size 索引主分片 复制分片 总占用存储空间
pri.store.size 索引总占用空间, 不计算复制分片 占用空间
green yellow red
Green means everything is good (cluster is fully functional),
yellow means all data is available but some replicas are not yet allocated (cluster is fully functional),
and red means some data is not available for whatever reason.
Note that even if a cluster is red, it still is partially functional
(it will continue to serve search requests from the available shards)
but you will likely need to fix it ASAP since you have missing data.
yellow 一些副本没有分配
red 一些数据不可用 (主分片丢失)
上一篇
下一篇
Elasticsearch analyzer 和 search_analyzer
Elasticsearch5快速入门
Elasticsearch分词器
Elasticsearch _all字段
elasticsearch mappings dynamic属性
一份牛逼的简历模板