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 小时前
ElasticSearch查询语句Query String详解:从入门到精通
后端·elasticsearch
Johny_Zhao19 小时前
OpenClaw安装部署教程
linux·人工智能·ai·云计算·系统运维·openclaw
洛森唛1 天前
Elasticsearch DSL 查询语法大全:从入门到精通
后端·elasticsearch
chlk1232 天前
Linux文件权限完全图解:读懂 ls -l 和 chmod 755 背后的秘密
linux·操作系统
舒一笑2 天前
Ubuntu系统安装CodeX出现问题
linux·后端
改一下配置文件2 天前
Ubuntu24.04安装NVIDIA驱动完整指南(含Secure Boot解决方案)
linux
深紫色的三北六号3 天前
Linux 服务器磁盘扩容与目录迁移:rsync + bind mount 实现服务无感迁移(无需修改配置)
linux·扩容·服务迁移
SudosuBash3 天前
[CS:APP 3e] 关于对 第 12 章 读/写者的一点思考和题解 (作业 12.19,12.20,12.21)
linux·并发·操作系统(os)
Elasticsearch3 天前
如何使用 Agent Builder 排查 Kubernetes Pod 重启和 OOMKilled 事件
elasticsearch
哈基咪怎么可能是AI3 天前
为什么我就想要「线性历史 + Signed Commits」GitHub 却把我当猴耍 🤬🎙️
linux·github