2016-10-28 85 views
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_numberunassigned_shards怎麼解決呢

**使用ES 2.4最新**

感謝你很

回答

1

這僅僅是因爲你有一個節點您的羣集但您的所有索引都配置爲每個分片具有一個副本(默認設置)。

如果您運行下面的命令,你會擺脫副本和羣集會變綠:

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

任何運氣嗎? – Val

+0

對於ES中的每個新創建的索引。我們需要點擊curl命令@val –

+0

您還可以在'elasticsearch.yml'中將其配置爲默認值 – Val

相關問題