2014-08-28 71 views
0

我創建了一個包含3個主碎片的索引,但ElasticSearch返回並指示有4個主碎片。ElasticSearch返回4個主碎片而不是3個

# Deleting the data in the cluster 
DELETE /_all 

# Create an index with 3 primary shards with 1 replica each 
PUT /blogs 
{ 
    "settings" : { 
     "number_of_shards" : 3, 
     "number_of_replicas" : 1 
    } 
} 

# Retrieve the cluster health 
GET /_cluster/health 

這裏是迴應:

{ 
    "cluster_name": "clus", 
    "status": "yellow", 
    "timed_out": false, 
    "number_of_nodes": 1, 
    "number_of_data_nodes": 1, 
    "active_primary_shards": 4, 
    "active_shards": 4, 
    "relocating_shards": 0, 
    "initializing_shards": 0, 
    "unassigned_shards": 4 
} 

我認爲,世界上只有副本碎片可能會改變和初級碎片的數量是固定的時候,該指數的數創建,哪裏來自第四個主要碎片?

回答

0

既然你的例子顯示奇蹟語法的東西,我假設你正在使用奇蹟。它會爲它自己的數據創建一個索引(所以這是你看到的第四個碎片)。試試GET /_cat/shards看到這個。

+0

就是這樣,謝謝 – Ydhem 2014-08-28 18:45:23

相關問題