ElasticSearch之Health API

查看当前集群全部健康指标的信息,执行如下命令:

shell 复制代码
curl -X GET "https://localhost:9200/_health_report?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"

执行结果输出如下:

shell 复制代码
{
  "status" : "green",
  "cluster_name" : "elasticsearch",
  "indicators" : {
    "master_is_stable" : {
      "status" : "green",
      "symptom" : "The cluster has a stable master node",
      "details" : {
        "current_master" : {
          "node_id" : "aKgBu7LgS9a6iPYH8n2JPw",
          "name" : "jackie-ubuntu"
        },
        "recent_masters" : [
          {
            "node_id" : "aKgBu7LgS9a6iPYH8n2JPw",
            "name" : "jackie-ubuntu"
          }
        ]
      }
    },
    "repository_integrity" : {
      "status" : "green",
      "symptom" : "No snapshot repositories configured."
    },
    "shards_availability" : {
      "status" : "green",
      "symptom" : "This cluster has all shards available.",
      "details" : {
        "initializing_primaries" : 0,
        "restarting_primaries" : 0,
        "started_primaries" : 1,
        "unassigned_replicas" : 0,
        "initializing_replicas" : 0,
        "creating_primaries" : 0,
        "restarting_replicas" : 0,
        "unassigned_primaries" : 0,
        "started_replicas" : 0,
        "creating_replicas" : 0
      }
    },
    "disk" : {
      "status" : "green",
      "symptom" : "The cluster has enough available disk space.",
      "details" : {
        "indices_with_readonly_block" : 0,
        "nodes_with_enough_disk_space" : 1,
        "nodes_with_unknown_disk_status" : 0,
        "nodes_over_high_watermark" : 0,
        "nodes_over_flood_stage_watermark" : 0
      }
    },
    "shards_capacity" : {
      "status" : "green",
      "symptom" : "The cluster has enough room to add new shards.",
      "details" : {
        "data" : {
          "max_shards_in_cluster" : 1000
        },
        "frozen" : {
          "max_shards_in_cluster" : 3000
        }
      }
    },
    "slm" : {
      "status" : "green",
      "symptom" : "No Snapshot Lifecycle Management policies configured",
      "details" : {
        "slm_status" : "RUNNING",
        "policies" : 0
      }
    },
    "ilm" : {
      "status" : "green",
      "symptom" : "Index Lifecycle Management is running",
      "details" : {
        "policies" : 20,
        "stagnating_indices" : 0,
        "ilm_status" : "RUNNING"
      }
    }
  }
}

查看当前集群健康指标比如shards_availability的信息,执行如下命令:

shell 复制代码
curl -X GET "https://localhost:9200/_health_report/shards_availability?pretty" --cacert $ES_HOME/config/certs/http_ca.crt -u "elastic:ohCxPH=QBE+s5=*lo7F9"

执行结果输出如下:

shell 复制代码
{
  "cluster_name" : "elasticsearch",
  "indicators" : {
    "shards_availability" : {
      "status" : "green",
      "symptom" : "This cluster has all shards available.",
      "details" : {
        "initializing_primaries" : 0,
        "restarting_primaries" : 0,
        "started_primaries" : 1,
        "unassigned_replicas" : 0,
        "initializing_replicas" : 0,
        "creating_primaries" : 0,
        "restarting_replicas" : 0,
        "unassigned_primaries" : 0,
        "started_replicas" : 0,
        "creating_replicas" : 0
      }
    }
  }
}

目前支持的指标:

  • master_is_stable
  • shards_availability
  • disk
  • ilm,即Indexing Lifecycle Management
  • repository_integrity
  • slm,即Snapshot Lifecycle Management
  • shards_capacity

相关资料

相关推荐
落羽的落羽39 分钟前
【算法札记】练习 | Week5
linux·服务器·c++·人工智能·计算机网络·算法·哈希算法
Evan_ZGYF丶1 小时前
【开发工具】【perf】Linux下性能分析工具(perf)的使用
linux·嵌入式·开发工具·perf
AC赳赳老秦2 小时前
OpenClaw任务复盘自动化:统计每日完成工作、遗留问题,优化工作节奏
java·大数据·linux·运维·服务器·数据库·openclaw
kaoa0002 小时前
Linux入门攻坚——79、XEN虚拟化-2
linux·运维·开发语言
AOwhisky2 小时前
学习自测(MySQL系列第一期、第二期)
linux·运维·数据库·学习·mysql·云计算
提伯斯6462 小时前
Jetson_Pixhawk局域网UDP连接QGC
linux·网络·嵌入式硬件·网络协议·udp·jetson
feng_you_ying_li3 小时前
liunx之线程控制与解析,页表,TLB
linux
2601_961194023 小时前
化学教资科三真题答案
linux·windows·ubuntu·pdf·centos·gnu
weixin_520649874 小时前
Modbus RTU
linux·运维·服务器
zhangfeng11334 小时前
超算中心 高性能计算 slurm的linux版本 centos7,如何安装docker,如何安装torch2.4
linux·运维·服务器·开发语言·人工智能·机器学习·docker