unassigned_shards如何解决它

时间:2016-10-28 12:35:16

标签: elasticsearch elasticsearch-2.0

curl -XGET 'http://localhost:9200/_cluster/health?level=shards'

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

如何解决未分配的分片和active_shards_percent_as_number

**使用ES 2.4最新**

感谢你

1 个答案:

答案 0 :(得分:2)

这只是因为您的群集中有一个节点,但所有索引都配置为每个分片有一个副本(默认设置)。

如果您运行以下命令,您将删除副本,您的群集将变为绿色:

curl -XPUT 'localhost:9200/_settings' -d '{
    "index" : {
        "number_of_replicas" : 0
    }
}'