1、修改elasticsearch.yml,增加path.repo,仓库的路径
path.repo: ["D://esdatabackup"]
2、仓库名称esdatabackup,文件系统fs
PUT _snapshot/esdatabackup
{
"type": "fs",
"settings": {
"location": "D://esdatabackup",
"compress": true
}
}
3、快照名称snapshot_es,备份哪些索引在indices指定
PUT _snapshot/esdatabackup/snapshot_es
{
"indices": "cq-t-subitem-pb,cq-t-bp-subitem,cq-tbpitem,cq-t-pkpm-pkr,cq-es-hr-item,cq-t-bp-project,cq-sys-project,cq-t-bp-attach"
}
4、列出快照信息
GET _snapshot/elk_backup/snapshot_1
GET _snapshot/elk_backup/_all --获取仓库中所有快照的完整列表
5、删除快照
DELETE _snapshot/elk_backup/snapshot_1
6、从快照恢复
POST _snapshot/elk_backup/snapshot_1/_restore