rsync + mysql + gzip + --single-transaction

1.rsync -avz 172.16.2.61:~/vs/program/elasticsearch-5.0.0 --exclude=elasticsearch-5.0.0/data/* ./

从其他节点的机器拷贝elasticsearch目录并忽略data目录

 

2、备份后直接压缩写入磁盘

备份mysqldump --single-transaction -hlocalhost  --all-databases --triggers --routines --events -P3306 -uroot -pxxxx |gzip >test.tar.gz

还原gunzip < test.tar.gz |mysql -hlocalhost -uroot -pxxxxx

posted @ 2018-05-23 15:10  littlevigra  阅读(156)  评论(2编辑  收藏  举报