创建仓库
POST http://10.10.14.201:9200/_snapshot/backup
{ "type": "fs", "settings": { "compress" : "true", #启动压缩 "location": "/usr/local/elasticsearch_snapshot" } }
备份快照
PUT http://10.10.14.201:9200/_snapshot/backup/snapshot_20190131?wait_for_completion=true
{ "ignore_unavailable": true, #是否忽略不可用的索引 "include_global_state": false #可以防止集群全局状态被被存储为快照的一部分 }
查看查看所有仓库信息
GET http://10.10.14.222:9200/_snapshot/
GET http://10.10.100.5:9200/_snapshot/esBackup/_all
esBackup:为仓库名
可以看到所有备份快照情况,按时间排最新的在最后
恢复快照
POST http://10.10.100.5:9200/_snapshot/esBackup/snapshot_20200417010000/_restore?wait_for_completion=true
esBackup:为仓库名
snapshot_20200417010000:快照名称