elasticsearch 查看集群运行状态api (全部Cat命令合集以及返回参数解释)

阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6


Cat 的所有命令

http://192.168.6.39:9201/_cat
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/tasks
/_cat/indices
/_cat/indices/{index}
/_cat/segments
/_cat/segments/{index}
/_cat/count
/_cat/count/{index}
/_cat/recovery
/_cat/recovery/{index}
/_cat/health
/_cat/pending_tasks
/_cat/aliases
/_cat/aliases/{alias}
/_cat/thread_pool
/_cat/thread_pool/{thread_pools}
/_cat/plugins
/_cat/fielddata
/_cat/fielddata/{fields}
/_cat/nodeattrs
/_cat/repositories
/_cat/snapshots/{repository}
/_cat/templates

/_cat/allocation 查看节点磁盘资源分配信息

shards disk.indices disk.used disk.avail disk.total disk.percent host         ip           node
    14      326.1mb    45.9gb    246.7gb    292.7gb           15 192.168.6.39 192.168.6.39 icoding-2
    14      472.9mb    45.9gb    246.7gb    292.7gb           15 192.168.6.39 192.168.6.39 icoding-1
    14      423.8mb    45.9gb    246.7gb    292.7gb           15 192.168.6.39 192.168.6.39 icoding-3
shards:分片数
disk.indices:索引index占用的空间大小
disk.used:已用磁盘空间
disk.avail:可用磁盘空间
disk.total:磁盘空间总量
disk.percent:磁盘已使用百分比
host:节点主机地址
ip:节点ip
node:节点名称

/_cat/shards 节点分片信息

index                      shard   prirep state     docs   store  ip            node
user_test                  0       r      STARTED      5   6.9kb  192.168.6.39  icoding-3
user_test                  0       p      STARTED      5   6.9kb  192.168.6.39  icoding-2

index:所有名称
shard:分片数
prirep:分片类型,p=pri=primary为主分片,r=rep=replicas为复制分片
state:分片状态,STARTED为正常分片,INITIALIZING为异常分片
docs:记录数
store:存储大小
ip:es节点ip
node:es节点名称

_cat/master?v 查看主节点

id                     host         ip           node
xXwTStNwRB6xYKomujcFHQ 192.168.6.39 192.168.6.39 icoding-2

/_cat/nodes 查看集群信息

ip           heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.6.39           76          83  -1    0.08    0.35     0.93 dilm      *      icoding-2
192.168.6.39           63          83  -1    0.08    0.35     0.93 dilm      -      icoding-1
192.168.6.39           64          83  -1    0.08    0.35     0.93 dilm      -      icoding-3
第一列(ip):es节点ip
第二列(heap.percent):堆内存占比
第三列(ram.percent):内存使用占比
第四列(cpu):cpu使用率
第五列(load_1m):1分钟内平均load情况,ms
第六列(load_5m):5分钟内平均load情况,ms
第七列(load_15m):15分钟内平均load情况,ms
第八列(node.role):节点权限
第九列(master):是否master节点,*为master节点
第十列(name):节点名称

/_cat/tasks 返回集群中一个或多个节点上当前执行的任务信息。

action                         task_id                       parent_task_id                type      start_time    timestamp running_time ip           node
cluster:monitor/tasks/lists    SiNobJTtQCC4-qbYC0J98Q:486155 -                             transport 1675762504110 09:35:04  428.7micros  192.168.6.39 icoding-1
cluster:monitor/tasks/lists[n] SiNobJTtQCC4-qbYC0J98Q:486156 SiNobJTtQCC4-qbYC0J98Q:486155 direct    1675762504110 09:35:04  144.8micros  192.168.6.39 icoding-1
cluster:monitor/tasks/lists[n] uedLYHQKRZaTv6DXdQl3NA:548483 SiNobJTtQCC4-qbYC0J98Q:486155 transport 1675762504111 09:35:04  66.6micros   192.168.6.39 icoding-3
cluster:monitor/tasks/lists[n] xXwTStNwRB6xYKomujcFHQ:913977 SiNobJTtQCC4-qbYC0J98Q:486155 transport 1675762504111 09:35:04  60micros     192.168.6.39 icoding-2

node	节点id。
id	任务编号。
type	任务类型。
action	任务功能。
description	任务描述信息,detailed为true时返回。
start_time_in_millis	任务开始时间。
running_time_in_nanos	任务执行纳秒数。
cancellable	任务是否支持取消操作。
parent_task_id	父任务id。
headers	头信息。

/_cat/indices 查看索引信息

health status index                           uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   .monitoring-kibana-7-2023.02.07 5v7F1P7FTk2oxEdeUX7FGg   1   1       3418            0      2.8mb          1.4mb
green  open   .apm-agent-configuration        vbBoG3f2RwuwxwMucVgMlQ   1   1          0            0       566b           283b
health:	索引的健康状态
status:	索引的开启状态
index:	索引名字
uuid:	索引的uuid
pri:	索引的主分片数量
rep:	索引的复制分片数量
docs.count:	索引下的文档总数
docs.deleted:	索引下删除状态的文档数
store.size:	主分片+复制分片的大小
pri.store.size:	主分片的大小

/_cat/segments 分片中的分段信息

index                           shard prirep ip           segment generation docs.count docs.deleted    size size.memory committed searchable version compound
.monitoring-kibana-7-2023.02.07 0     r      192.168.6.39 _0               0          1            0  15.9kb        4577 true      true       8.2.0   true
.monitoring-kibana-7-2023.02.07 0     r      192.168.6.39 _1               1       3049            0   1.2mb        8900 true      true       8.2.0   true
.monitoring-kibana-7-2023.02.07 0     r      192.168.6.39 _2               2          1            0    16kb        4577 false     true       8.2.0   true
index:	索引名称
shard:	分片名称
prirep:	主分片还是副本分片
ip:	所在节点IP
segment:	segments段名
generation:	分段生成
docs.count:	段中的文档树
docs.deleted:	段中删除的文档数
size:	段大小,以字节为单位
size.memory:	段内存大小,以字节为单位
committed:	段是否已提交
searchable:	段是否可搜索
version:	版本
compound:	compound模式

/_cat/count 查看当前集群的doc数量

epoch      timestamp count
1675763425 09:50:25  996706
epoch:	自标准时间(1970-01-01 00:00:00)以来的秒数
timestamp:	时间
count:	文档总数

/_cat/recovery 显示正在进行和先前完成的索引碎片恢复的视图

index                           shard time  type           stage source_host  source_node target_host  target_node repository snapshot files files_recovered files_percent files_total bytes     bytes_recovered bytes_percent bytes_total translog_ops translog_ops_recovered translog_ops_percent
.monitoring-kibana-7-2023.02.07 0     8.5s  peer           done  192.168.6.39 icoding-2   192.168.6.39 icoding-1   n/a        n/a      4     4               100.0%        4           16696     16696           100.0%        16696       8460         8460                   100.0%
.monitoring-kibana-7-2023.02.07 0     1.6s  peer           done  192.168.6.39 icoding-2   192.168.6.39 icoding-3   n/a        n/a      29    29              100.0%        29          3278888   3278888         100.0%        3278888   
index:	索引名称
shard:	分片名称
time:	恢复时间
type:	恢复类型
stage:	恢复阶段
source_host:	源主机
source_node:	源节点名称
target_host:	目标主机
target_node:	目标节点名称
repository:	仓库
snapshot:	快照
files:	要恢复的文件数
files_recovered:	已恢复的文件数
files_percent:	恢复文件百分比
files_total:	文件总数
bytes:	要恢复的字节数
bytes_recovered:	已恢复的字节数
bytes_percent:	恢复字节百分比
bytes_total:	字节总数
translog_ops:	要恢复的translog操作数
translog_ops_recovered:	已恢复的translog操作数
translog_ops_percent:	恢复的translog操作的百分比

/_cat/health

epoch      timestamp cluster        status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1675824703 02:51:43  icoding-course green           3         3     42  21    0    0        0             0                  -                100.0%
epoch:	自标准时间(1970-01-01 00:00:00)以来的秒数
timestamp:	时间
cluster:	集群名称
status:	集群状态
node.total:	节点总数
node.data:	数据节点总数
shards:	分片总数
pri:	主分片总数
repo:	复制节点的数量
init:	初始化节点的数量
unassign:	未分配分片的数量
pending_tasks:	待定任务数
max_task_wait_time:	等待最长任务的等待时间
active_shards_percent:	活动分片百分比

/_cat/pending_tasks 显示正在等待的任务

insertOrder timeInQueue priority source
insertOrder:	任务插入顺序
timeInQueue:	任务排队了多长时间
priority:	任务优先级
source:	任务源

/_cat/aliases 显示别名、过滤器、路由信息

alias                index                      filter routing.index routing.search is_write_index
logstash             logstash-2023.02.06-000001 -      -             -              true
.kibana              .kibana_1                  -      -             -              -
.kibana_task_manager .kibana_task_manager_1     -      -             -              -
alias:	别名
index:	索引别名指向
filter:	过滤规则
routing.index:	索引路由
routing.search:	搜索路由

/_cat/thread_pool 查看线程池信息

node_name name                active queue rejected
node10    bulk                     1     0        4
node10    fetch_shard_started      0     0        0

node_name:	节点名称
name:	线程池名称
active:	活跃线程数量
queue:	当前队列中的任务数
rejected:	被拒绝的任务数

/_cat/plugins 显示每个运行插件节点的视图

name component version
name:	节点名称
component:	插件名称
version:	插件版本

/_cat/fielddata #查看每个数据节点上fielddata当前占用的堆内存。

id                     host         ip           node      field                       size
xXwTStNwRB6xYKomujcFHQ 192.168.6.39 192.168.6.39 icoding-2 cluster_uuid               1.7kb
xXwTStNwRB6xYKomujcFHQ 192.168.6.39 192.168.6.39 icoding-2 source_node.name           1.6kb
xXwTStNwRB6xYKomujcFHQ 192.168.6.39 192.168.6.39 icoding-2 type                        656b
全文检索用倒排索引非常合适;但过滤、分组聚合、排序这些操作,正排索引更合适。
ES中引入了fielddata的数据结构用来做正排索引。如果需要对某一个字段排序、分组聚合、过滤,则可将字段设置成fielddata。
默认情况下:
  text类型的字段是不能分组及排序的,如需要则需要开启该字段的fielddata=true,但是这样耗费大量的内存,不建议这么使用。
  keyword类型默认可分组及排序。

fielddata默认是采用懒加载的机制加载到堆内存中。当某个字段基数特别大,可能会出现OOM。

/_cat/nodeattrs 查看每个节点的自定义属性

node      host         ip           attr              value
icoding-2 192.168.6.39 192.168.6.39 ml.machine_memory 33712148480
icoding-2 192.168.6.39 192.168.6.39 ml.max_open_jobs  20
icoding-2 192.168.6.39 192.168.6.39 xpack.installed   true
icoding-1 192.168.6.39 192.168.6.39 ml.machine_memory 33712148480
icoding-1 192.168.6.39 192.168.6.39 ml.max_open_jobs  20
icoding-1 192.168.6.39 192.168.6.39 xpack.installed   true
icoding-3 192.168.6.39 192.168.6.39 ml.machine_memory 33712148480
icoding-3 192.168.6.39 192.168.6.39 ml.max_open_jobs  20
icoding-3 192.168.6.39 192.168.6.39 xpack.installed   true
node	node name	节点名称
host	host name	host
ip	    ip address	ip
attr	attribute description	属性描述
value	attribute value	属性值

/_cat/repositories /_cat/snapshots/{repository} 查看注册的快照仓库

id type

/_cat/templates 模板

name                        index_patterns                order      version
.triggered_watches          [.triggered_watches*]         2147483647 
.logstash-management        [.logstash]                   0          
.watches                    [.watches*]                   2147483647 
.ml-config                  [.ml-config]                  0          7040099
.monitoring-logstash        [.monitoring-logstash-7-*]    0          7000199
.ml-anomalies-              [.ml-anomalies-*]             0          7040099
.watch-history-10           [.watcher-history-10*]        2147483647 
.ml-state                   [.ml-state*]                  0          7040099
.slm-history                [.slm-history-1*]             2147483647 
.monitoring-alerts-7        [.monitoring-alerts-7]        0          7000199
.data-frame-internal-2      [.data-frame-internal-2]      0          7040099
.data-frame-notifications-1 [.data-frame-notifications-*] 0          7040099
.ml-meta                    [.ml-meta]                    0          7040099
.monitoring-beats           [.monitoring-beats-7-*]       0          7000199
.monitoring-es              [.monitoring-es-7-*]          0          7000199
.ml-notifications           [.ml-notifications]           0          7040099
.management-beats           [.management-beats]           0          70000
.monitoring-kibana          [.monitoring-kibana-7-*]      0          7000199


name	template name	模板名称
index_patterns	template index patterns	模板匹配规则
order	template application order number	模板优先级
version	version	模板版本


阿里云国内75折 回扣 微信号:monov8
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6