Let’s start with a basic health check, which we can use to see how our cluster is doing. We’ll be using curl to do this but you can use any tool that allows you to make HTTP/REST calls. Let’s assume that we are still on the same node where we started Elasticsearch on and open another command shell window.
_cat
API. You can run the command below in
Kibana’s Console by clicking "VIEW IN CONSOLE" or with
curl
by clicking the "COPY AS CURL" link below and pasting it into a terminal.
GET /_cat/health?v
And the response:
epoch timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent 1475247709 17:01:49 elasticsearch green 1 1 0 0 0 0 0 0 - 100.0%
We can see that our cluster named "elasticsearch" is up with a green status.
我们可以看到名为“elasticsearch”的群集处于绿色状态。
Whenever we ask for the cluster health, we either get green, yellow, or red.
每当我们要求群集健康时,我们要么获得绿色,黄色或红色。
1、Green - everything is good (cluster is fully functional)GET /_cat/nodes?v
And the response:
ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name 127.0.0.1 10 5 5 4.46 mdi * PB2SGZY
Here, we can see our one node named "PB2SGZY", which is the single node that is currently in our cluster.