ES數據備份到HDFS

1.準備好HDFS(這裏我是本機測試)

 

2.es 安裝repository-hdfs插件

(如es爲多節點需在每一個節點都安裝插件)elasticsearch

 

 

elasticsearch-plugin install repository-hdfs

3. 重啓ES

 

4.建立快照倉庫

PUT /_snapshot/backup_hdfs測試

{
  "type": "hdfs",
  "settings": {
    "uri": "hdfs://localhost:8020/",
    "path": "elasticsearch/respositories/my_hdfs_repository",
    "conf.dfs.client.read.shortcircuit": "true"
  }
}

5.查看快照倉庫

GET /_snapshot/_allui

6.建立快照

PUT /_snapshot/backup_hdfs/snapshot_1url

{
  "indices": "logstash-2018-08-08,index_2",//注意不設置這個屬性,默認是備份全部
  "ignore_unavailable": true,
  "include_global_state": false
}

7.恢復快照

POST /_snapshot/backup_hdfs/snapshot_1/_restore
spa

{
  "indices": "zhangmingli", //指定索引恢復,不指定就是全部
  "ignore_unavailable": true,//忽略恢復時異常索引
  "include_global_state": false//是否存儲全局轉態信息,fasle表明有一個或幾個失敗,不會致使整個任務失敗
}

8.刪除快照

DELETE /_snapshot/backup_hdfs/snapshot_1
插件

相關文章
相關標籤/搜索