Elasticsearch备份迁移

yum install fuse sshfs

在其中一个机器上

sshfs root@192.168.0.4:/7890/backup /7890/backup -o nonempty

在所有节点上

path.repo: [“/7890/backup”]

创建备份目录

curl -XPUT http://192.168.0.4:19200/_snapshot/backup -d ‘{“type”:”fs”,”settings”:{“location”:”/7890/backup/”}}’

备份

curl -XPUT  http://192.168.0.4:19200/_snapshot/backup/coolook_es_20160401.tar.gz?wait_for_completion=true

查看备份

curl -XGET http://192.168.0.4:19200/_snapshot/backup/snapshot_test/_status

删除备份

curl -XDELETE http://192.168.0.4:19200/_snapshot/backup/coolook_es_20160401.tar.gz

恢复备份

curl -XPOST  http://192.168.0.4:19200/_snapshot/backup/coolook_es_20160401.tar.gz/_restore

压缩打包

nohup tar -jcvf backup.tar.bz2 backup/* &
nohup tar -jxv -f backup.tar.bz2 &

发表评论