2014-09-30 77 views
1

如果彈性搜索快照包含多個索引(例如:wikipedia,ehow,howStaffWorks),我們可以只將這些索引中的一個加載到elasticsearch服務器中,還是在加載快照時必須加載所有索引?Elasticsearch快照

回答

4

在elasticsearch網站的documentation顯示從快照中恢復具體指標:

curl -XPOST "localhost:9200/_snapshot/my_backup/snapshot_1/_restore" -d '{ 
"indices": "index_1,index_2", 
"ignore_unavailable": "true", 
"include_global_state": false, 
"rename_pattern": "index_(.+)", 
"rename_replacement": "restored_index_$1" 
}' 

indices以上。

0

是的,你可以。無需加載所有索引。

curl -XPOST "localhost:9200/_snapshot/my_backup/snapshot_1/_restore" -d '{ 
    "indices": "index_1", 
    "ignore_unavailable": "true", 
    "include_global_state": false, 
    "rename_pattern": "index_(.+)", 
    "rename_replacement": "restored_index_$1" 
}' 

對於加載所有索引您可以使用下面的代碼,(感覺插件)

PUT /_snapshot/my_backup/snapshot_1?wait_for_completion=true 
0

是的,我們可以加載。

$ curl -XPUT 'http://localhost:9200/twitter/' -d ' 
     "index" : { 
      "number_of_shards" : 3, 
      "number_of_replicas" : 2