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

相关资料

相关推荐
无泪无花月隐星沉26 分钟前
uos server 1070e lvm格式磁盘扩容分区
linux·运维·uos
Elastic 中国社区官方博客33 分钟前
Elasticsearch:在 X-mas 吃一些更健康的东西
android·大数据·数据库·人工智能·elasticsearch·搜索引擎·全文检索
食咗未1 小时前
Linux USB HOST EXTERNAL STORAGE
linux·驱动开发
食咗未1 小时前
Linux USB HOST HID
linux·驱动开发·人机交互
Xの哲學1 小时前
Linux SLAB分配器深度解剖
linux·服务器·网络·算法·边缘计算
齐鲁大虾2 小时前
UOS(统信操作系统)如何更新CUPS(通用Unix打印系统)
linux·服务器·chrome·unix
虾..3 小时前
Linux 简单日志程序
linux·运维·算法
huoxingwen4 小时前
Ubuntu 22.04 上 VMware Workstation 点击虚拟机窗口就消失的解决历程
linux·运维·ubuntu
姚青&4 小时前
Linux 常用命令之基本命令
linux·运维·服务器
一路往蓝-Anbo4 小时前
【第05期】数据的微观世界 (五) —— 浮点数 vs 定点数:MCU的数学课
linux·stm32·单片机·嵌入式硬件·物联网