ES集群

版权声明:本文为博主原创文章,欢迎转载。 https://blog.csdn.net/chengyuqiang/article/details/85282267

官方网址:
https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-cluster-health.html

1、集群健康

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.
当我们进行基本运行状况检查时,我们可以使用它来查看集群的运行情况。 我们将使用curl来执行此操作,但您可以使用任何允许您进行HTTP / REST调用的工具。 假设我们仍然在我们启动Elasticsearch的同一节点上打开另一个命令shell窗口。

To check the cluster health, we will be using the _cat API. 要检查群集运行状况,我们将使用_cat API。

GET /_cat/health?v

在Kibana控制台中运行以下命令,执行结果如下:

epoch      timestamp cluster status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1545892680 14:38:00  es      green           3         3     22  11    0    0        0             0                  -                100.0%

Whenever we ask for the cluster health, we either get green, yellow, or red.
每当我们要求群集健康时,我们要么获得绿色,黄色或红色。

  • Green - everything is good (cluster is fully functional). 绿色 - 一切都很好(集群功能齐全)
  • Yellow - all data is available but some replicas are not yet allocated (cluster is fully functional). 黄色 - 所有数据都可用,但尚未分配一些副本(群集功能齐全)
  • Red - some data is not available for whatever reason (cluster is partially functional) . 红色 - 某些数据由于某种原因不可用(群集部分功能)

2、节点

We can also get a list of nodes in our cluster as follows:
我们还可以获得群集中的节点列表,如下所示:

GET /_cat/nodes?v
ip           heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
10.11.13.104           48          23   0    0.00    0.01     0.05 mdi       -      elastic3
10.11.13.102           30          35   0    0.04    0.03     0.05 mdi       *      elastic1
10.11.13.103           49          23   0    0.00    0.01     0.05 mdi       -      elastic2

3、查看集群索引

GET /_cat/indices?v
health status index   uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   test    GHdZr5owTwexU_RJsasSJw   5   1         31            0      293kb        146.5kb
green  open   .kibana AV5KHChzRzubIwZQ3_SqKg   1   1          1            0        8kb            4kb
green  open   news    3kNoB5ORS2-XasQuf6pCdA   5   1          0            0      2.5kb          1.2kb

猜你喜欢

转载自blog.csdn.net/chengyuqiang/article/details/85282267