2014-09-30 78 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