elasticsearch 状态 | 使用 _cat 查看 es 状态信息

描述:

     通过接口访问,查看 es 单机和集群状态,十分方便。

常用接口:

配置查看http://127.0.0.1:9200/_cat/allocation?v

shards disk.indices disk.used disk.avail disk.total disk.percent host      ip        node
     2       10.1kb    48.8gb     20.1gb       69gb           70 127.0.0.1 127.0.0.1 tez6ctE

说明:

  • shards  分片
  • disk.indices  磁盘索引
  • disk.used    磁盘使用过的
  • disk.avail    磁盘有效
  • disk.total    磁盘总数
  • disk.percent   磁盘百分比
  • host    主机
  • ip    ip地址
  • node   节点

分片查看http://127.0.0.1:9200/_cat/shards?v

index   shard prirep state   docs store ip        node
grwegew 0     p      STARTED    1 3.4kb 127.0.0.1 tez6ctE
dqadq   0     p      STARTED    2 6.6kb 127.0.0.1 tez6ctE

具体索引分片http://127.0.0.1:9200/_cat/shards/{index}?v

index   shard prirep state   docs store ip        node
grwegew 0     p      STARTED    1 3.4kb 127.0.0.1 tez6ctE

_cat 命令大全,基本上都是见名知意

  • /_cat/allocation
  • /_cat/shards
  • /_cat/shards/{index}
  • /_cat/master
  • /_cat/nodes
  • /_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/plugins
  • /_cat/fielddata
  • /_cat/fielddata/{fields}
  • /_cat/nodeattrs
  • /_cat/repositories
  • /_cat/snapshots/{repository}

verbose

每个命令都支持使用 ?v 参数,来显示详细的信息:

$ curl localhost:9200/_cat/master?v

help

每个命令都支持使用 help 参数,来输出可以显示的列:

$ curl localhost:9200/_cat/master?help

headers

通过 h 参数,可以指定输出的字段:

$ curl localhost:9200/_cat/master?v
$ curl localhost:9200/_cat/master?h=ip,node

数字类型的格式化

很多的命令都支持返回可读性的大小数字,比如使用 mb 或者 kb 来表示。

$ curl localhost:9200/_cat/indices?v

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值