zoukankan      html  css  js  c++  java
  • Elasticsearch——使用_cat查看Elasticsearch状态

    Elasticsearch中信息很多,如果单凭肉眼来寻找复杂数据之间的关系,是很困难的。因此cat命令应运而生,它帮助开发者快速查询Elasticsearch的相关信息。

    _cat命令

    通过使用_cat可以查看支持的命令:

    $ curl localhost:9200/_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
    id                     host      ip        node
    QG6QrX32QSi8C3-xQmrSoA 127.0.0.1 127.0.0.1 Manslaughter

    help

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

    $ curl localhost:9200/_cat/master?help
    id   |   | node id
    host | h | host name
    ip   |   | ip address
    node | n | node name

    headers

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

    $ curl localhost:9200/_cat/master?v
    id                     host      ip        node
    QG6QrX32QSi8C3-xQmrSoA 127.0.0.1 127.0.0.1 Manslaughter
    
    $ curl localhost:9200/_cat/master?h=host,ip,node
    127.0.0.1 127.0.0.1 Manslaughter

    数字类型的格式化

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

    $ curl localhost:9200/_cat/indices?v
    health status index pri rep docs.count docs.deleted store.size pri.store.size
    yellow open   test    5   1          3            0      9.kb          9.kb
  • 相关阅读:
    linux CGI GET POST 用户登录
    linux内核 简化版ksetexample.c解析
    定制.vimrc配置文件
    procfs信息读取实现案例
    基于Extent 的文件存储(fiemap)
    inode_operations介绍
    Linux 文件系统概述
    linux硬链接与软连接的区别
    procfs读写信息实例
    VC 常见问题百问 20080129 13:37 271人阅读 评论(0) 收藏
  • 原文地址:https://www.cnblogs.com/a-du/p/9046766.html
Copyright © 2011-2022 走看看