简体   繁体   English

Elasticsearch集群只有一个节点的绿色

[英]elasticsearch cluster green with only one node

I have an elasticsearch cluster that only reports that it is green but reports only one node . 我有一个elasticsearch集群,该集群仅报告其为绿色,但仅报告一个节点。 From my research the cluster should be yellow and there should be two separate clusters . 根据我的研究,聚类应该是黄色的,并且应该有两个单独的聚类。 So could someone explain why the cluster below is reporting a green status ? 那么有人可以解释为什么下面的集群报告绿色状态吗?

{
  "cluster_name" : "elasticsearch",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 1,
  "number_of_data_nodes" : 1,
  "active_primary_shards" : 2,
  "active_shards" : 2,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "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" : 100.0
}

The cluster is being configured for clustering in elasticsearch.yml , and before those changes it properly reported a yellow status with the same 2 shards per node . 该集群已在elasticsearch.yml中配置为集群,在进行更改之前,集群正确报告了黄色状态,每个节点具有相同的2个分片。

you have two primary shards in your cluster with no replica. 您的群集中有两个没有副本的主要分片。 both shards are assigned to one data node. 两个分片都分配给一个数据节点。

if you increase Number_of_replicas to 1 or higher, you would see the yellow status of cluster. 如果将Number_of_replicas增加到1或更高,则会看到群集的黄色状态。 on that moment you can do two things. 在那一刻,您可以做两件事。 1) add another data node. 1)添加另一个数据节点。 2) change elastic setting to force assign both primary and replica shards to one node (not recommended). 2)更改弹性设置以强制将主分片和副本分片都分配给一个节点(不建议)。

The cluster is green because there are 0 unassigned shards - every shard that needs a home has one. 集群是绿色的,因为有0个未分配的分片-每个需要房屋的分片都有一个。 This is likely because you have indices with number_of_replicas set to 1, and since you have 1 active node in your cluster, all replica requirements are satisfied. 这可能是因为您将number_of_replicas索引设置为1,并且由于集群中有1个活动节点,所以满足了所有副本要求。 This is generally a bad idea, as it doesn't provide any redundancy. 这通常是一个坏主意,因为它不提供任何冗余。

If you create indices with number_of_replicas set to a value larger than 1, you will need at least that many machines active in the cluster to be eligible for green status. 如果创建的索引的number_of_replicas设置为大于1的值,则至少需要集群中活动的许多计算机符合绿色状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM