Elasticsearch 基于JSON的集群健康
示例
该示例使用基本的HTTP语法。<#>复制示例时,应删除示例中的所有内容。
这些_catAPI通常使人们很方便地获得有关集群的一目了然的详细信息。但是您经常希望一致地可解析的输出与软件一起使用。通常,JSONAPI是用于此目的的。
GET /_cluster/health
_cluster/health从Elasticsearch1.x开始存在,但是这里是Elasticsearch5.x输出的示例:
{
"cluster_name": "elasticsearch",
"status": "yellow",
"timed_out": false,
"number_of_nodes": 1,
"number_of_data_nodes": 1,
"active_primary_shards": 45,
"active_shards": 45,
"relocating_shards": 0,
"initializing_shards": 0,
"unassigned_shards": 44,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks": 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 50.56179775280899
}