2016-02-05 103 views
0

我与ES 2.2Elasticsearch恢复后指数仍为红色。如何把它变成绿色?

工作指标恢复后与

POST /_snapshot/s3_repository/snapshot_traces_291215/_restore 
{ 
    "include_global_state": false 
} 

我的指数仍然红red open traces_v2 3 1

这里是集群健康:

{ 
    "cluster_name": "burst", 
    "status": "red", 
    "timed_out": false, 
    "number_of_nodes": 1, 
    "number_of_data_nodes": 1, 
    "active_primary_shards": 0, 
    "active_shards": 0, 
    "relocating_shards": 0, 
    "initializing_shards": 0, 
    "unassigned_shards": 6, 
    "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": 0 
} 

我相信恢复完成。我检查与GET /_cat/recovery?v

GET /_cat/_shards?v给我:

index  shard prirep state  docs store ip node 
traces_v2 2  p  UNASSIGNED      
traces_v2 2  r  UNASSIGNED      
traces_v2 1  p  UNASSIGNED      
traces_v2 1  r  UNASSIGNED      
traces_v2 0  p  UNASSIGNED      
traces_v2 0  r  UNASSIGNED 

可以在那里的2.1快照和ES 2.2的任何版本不兼容?

+0

你有6个未分配的碎片和0个活动的碎片 - 这是不好的。通过运行'curl -XGET“来查看详细的分片信息http:// localhost:9200/_cat/shards?v”' –

+0

我编辑了我的问题来粘贴结果 – dagatsoin

回答

0

我强制将初选碎片分配给我的节点。

GET _cluster/reroute 
{ 
    "commands" : [ { 
      "allocate" : { 
       "index" : "traces_v2", 
       "shard" : "2", 
       "node" : "Killer Shrike", 
       "allow_primary" : true 
      } 
     } 
    ] 
} 

但状态仍然是黄色,因为我在单个节点上运行ES,并且有3个副本碎片。副本分片无法在已具有主分片的节点上运行。

所以我删除了他们通过指标设定副本碎片的数量为0。

PUT /_settings 
{ 
    "index" : { 
     "number_of_replicas" : 0 
    } 
} 

我希望这将帮助其他小白人跟我一样!

相关问题