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

相关资料

相关推荐
贝锐4 分钟前
远程控制如何赋能全平台设备?信创环境下贝锐向日葵的跨平台优势
linux·运维·远程控制
SurpriseDPD10 分钟前
Linux 内核 static_branch_likely:零开销条件分支
linux
li16709027012 分钟前
第2课:Linux基础指令(上)
linux·运维·服务器
li16709027013 分钟前
第1课:Linux环境部署
linux·运维·服务器·vim
tian_jiangnan14 分钟前
Proxmox VE – 修复 LVM Thin Pool “pve/data” 激活失败
linux·服务器·centos
程序员JerrySUN20 分钟前
Jetson边缘嵌入式实战课程第三讲:L4T 与 Jetson 系统架构
linux·服务器·人工智能·安全·unity·系统架构·游戏引擎
Elastic 中国社区官方博客25 分钟前
jina-embeddings-v5-omni:用于文本、图像、音频和视频的 embeddings
大数据·人工智能·elasticsearch·搜索引擎·ai·音视频·jina
泓博27 分钟前
Openclaw-Ubuntu常用命令
大数据·elasticsearch·搜索引擎·ai
鹏大师运维34 分钟前
统信UOS CVE-2026-31431漏洞怎么修?先看漏洞,再看3种修复方法
linux·内核·deb·漏洞修复·统信uos·补丁·本地提权
WhoAmI36 分钟前
Elasticsearch实战指南:构建实时全文检索系统
elasticsearch·kafka