Backup and Restore

備份與還原

測試版本:5.6.3

建立資料夾

bitnami:需要加-H 'Content-Type: application/json'

-H 'Content-Type: application/json'

資料夾設定

# 打開資料夾所有權限  避免使用者權限問題
sudo chmod -R 777 [path]

# 檢視資料夾詳細設定
ls -al [path]

elasticsearch.yml設定

更新elasticsearch.yml內容 (cluster每一台都要?)

# 新增備份絕對路徑
path.repo: ["/mnt/es_backup"]

設定完成後重啟es server

Repository設定

建立repository

檢查repository設定是否成功

如果在建立或檢查repository時出現資料夾權限錯誤(repository verification exception)

可自行建立sshfs共享資料夾來解決(參考Linux/sshfs)

查詢所有repository設定

刪除註冊完成的repository

Snapshot設定

建立snapshot並自行命名,包含所有index

建立特定index的snapshot

查詢snapshot建立進度

查詢所有snapshot版本

刪除snapshot

恢復snapshot

列出所有index

先刪除特定index

關閉index

指定snapshot進行恢復

指定snapshot中的index進行恢復

查看恢復進度

參考連結: https://docs.bitnami.com/virtual-machine/apps/elasticsearch/ https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html http://droidspa.blogspot.com/2016/11/elasticsearch-backup-and-restore.html http://www.itread01.com/content/1495128248.html http://keenwon.com/1393.html http://openskill.cn/article/468 http://smallasa.com/2017/03/09/elasticsearch-backup-and-restore/

Last updated

Was this helpful?