(如es爲多節點需在每一個節點都安裝插件)elasticsearch
elasticsearch-plugin install repository-hdfs |
PUT /_snapshot/backup_hdfs測試
{ "type": "hdfs", "settings": { "uri": "hdfs://localhost:8020/", "path": "elasticsearch/respositories/my_hdfs_repository", "conf.dfs.client.read.shortcircuit": "true" } } |
GET /_snapshot/_allui
PUT /_snapshot/backup_hdfs/snapshot_1url
{ "indices": "logstash-2018-08-08,index_2",//注意不設置這個屬性,默認是備份全部 "ignore_unavailable": true, "include_global_state": false } |
POST /_snapshot/backup_hdfs/snapshot_1/_restore
spa
{ "indices": "zhangmingli", //指定索引恢復,不指定就是全部 "ignore_unavailable": true,//忽略恢復時異常索引 "include_global_state": false//是否存儲全局轉態信息,fasle表明有一個或幾個失敗,不會致使整個任務失敗 } |
DELETE /_snapshot/backup_hdfs/snapshot_1
插件