innobackuppex全备与恢复

1)、下载
https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.7/binary/tarball/percona-xtrabackup-2.4.7-Linux-x86_64.tar.gz
tar xzvf percona-xtrabackup-2.4.7-Linux-x86_64.tar.gz
 
2)、Innobackupex相关依赖包的安装
 
 yum install perl-DBI
 yum install perl-DBD-MySQL
 yum install perl-Time-HiRes
 yum install perl-IO-Socket-SSL
3)、添加环境变量
 vi .bash_profile
PATH=$PATH:$HOME/bin:/apps/mysql5.7.16/bin:/apps/xtrabackup-2.4.7/bin
 PATH=$PATH:$HOME/bin:/apps/mysql5.7.16/bin:/apps/xtrabackup-2.4.7/bin


全备
/xtrabackup/xtrabackup-2.4.7/bin/innobackupex --defaults-file=/etc/my.cnf  --user=root --password=  /data/myback/innodbbackup/


恢复

/xtrabackup/xtrabackup-2.4.7/bin/innobackupex --defaults-file=/etc/my.cnf  --user=root --password= --apply-log  /data/myback/innodbbackup/

/xtrabackup/xtrabackup-2.4.7/bin/innobackupex --defaults-file=/etc/my.cnf  --user=root --password= --copy-back  /data/myback/innodbbackup/

或:
恢复binlogr
[root@robot-pbs-bigdata-02 ~]# ./xtrabackup/xtrabackup/bin/innobackupex --defaults-file=/etc/my.cnf --apply-log  /data/xtrabackup/2017-09-07_15-04-49/

恢复库
[root@robot-pbs-bigdata-02 ~]# ./xtrabackup/xtrabackup/bin/innobackupex  --defaults-file=/etc/my.cnf    --copy-back /data/xtrabackup/2017-09-07_15-04-49/


改data权限
启动……


网站名称:innobackuppex全备与恢复
转载注明:http://hbruida.cn/article/pcoicp.html