2015-03-03 21 views

回答

1

這是一個兩個步驟

  1. 標籤與鍵值對您的節點。例如:對於較小的機器,將它們標記爲boxType:small,爲了更好的機器,將它們標記爲boxType:big。
curl -XPUT localhost:9200/index-name/_settings -d '{ 
     "index.routing.allocation.include.tag" : "big" 
    }' 
3

您需要「標記」節點並指定使用node.tag屬性:http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-allocation.html#shard-allocation-filtering

並且您爲每個64GB節點(每個節點一個)指定node.tag: large1node.tag: large2

然後,當您創建索引時,可以使用"index.routing.allocation.include.tag" : "large1,large2"(這些是64GB節點)指定希望如何分配索引。當您決定將索引從兩個節點移動到另外兩個節點時,則更新上述屬性並指定"small1,small2"(例如較小的16GB節點)。

我建議看看Curator,它可以幫助你改變這些設置。

相關問題