记录备份es
备份ES
创建仓库testindexbak(任意名称)
curl -XPUT 'http://172.12.1.1:9200/_snapshot/testindexbak' -d '{
"type": "fs",
"settings": {
"compress" : "true",
"location": "/opt/sys/backup/testindexbak"
}
}'
备份数据
curl -XPUT 'http://172.12.1.1:9200/_snapshot/testindexbak/snapshot_1' -d '{
"indices": "testindex" #####需要备份的索引
}'
恢复ES(在主节点master上恢复)
创建仓库testindexbak(备份时的)
curl -XPUT 'http://192.168.1.1:9200/_snapshot/testindexbak' -d '{
"type": "fs",
"settings": {
"compress" : "true",
"location": "/opt/sys/backup/testindexbak"
}
}'
恢复数据
curl -XPOST 'http://192.168.1.1:9200/_snapshot/testindexbak/snapshot_1/_restore'
参考:https://blog.csdn.net/u014431852/article/details/52905821