Xtrabackup运用案例
发布时间:2022-09-03 11:33 所属栏目:115 来源:互联网
导读:Xtrabackup运用案例: 一、备份用户创建 CREATE USER bkpuser@localhost IDENTIFIED BY bkpuser; GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON . TO bkpuser@localhost; FLUSH PRIVILEGES; 二、备份 -- 执行备份 (不带时间戳) /usr/local/x
Xtrabackup运用案例: 一、备份用户创建 CREATE USER 'bkpuser'@'localhost' IDENTIFIED BY 'bkpuser'; GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON . TO 'bkpuser'@'localhost'; FLUSH PRIVILEGES; 二、备份 -- 执行备份 (不带时间戳) /usr/local/xtrabackup/bin/innobackupex --defaults-file=/data/mysql/db_test/conf/test.cnf --user=bkpuser --password=bkpuser --socket=/data/mysql/db_test/mysql.sock --parallel=8 --slave-info --no-timestamp /data/backups/full -- 执行备份 (带时间戳) /usr/local/xtrabackup/bin/innobackupex --defaults-file=/data/mysql/db_test/conf/test.cnf --user=bkpuser --password=bkpuser --socket=/data/mysql/db_test/mysql.sock --parallel=8 --slave-info /data/backups/full -- 执行备份 (具体某个库) /usr/local/xtrabackup/bin/innobackupex --defaults-file=/data/mysql/db_test/conf/test.cnf --user=bkpuser --password=bkpuser --socket=/data/mysql/db_test/mysql.sock --databases=t1 --parallel=8 --slave-info /data/backups/full -- 执行备份 (增量备份,全备基础上进行增量备份) /usr/local/xtrabackup/bin/innobackupex --defaults-file=/data/mysql/db_test/conf/test.cnf --user=bkpuser --password=bkpuser --socket=/data/mysql/db_test/mysql.sock --incremental-basedir=/data/backups/full/2018-05-02_13-42-59/ --incremental /data/backups/inc -- 执行备份 (增量备份,增备基础上进行增量备份) /usr/local/xtrabackup/bin/innobackupex --defaults-file=/data/mysql/db_test/conf/test.cnf --user=bkpuser --password=bkpuser --socket=/data/mysql/db_test/mysql.sock --incremental-basedir=/data/backups/inc/2018-05-02_13-44-24/ --incremental /data/backups/inc 三、恢复 -- 全量恢复 rm -rf /data/mysql/db_test/data/ #删除数据目录 rm -rf /data/mysql/db_test/ulog/ #删除数据目录 /usr/local/xtrabackup/bin/innobackupex --defaults-file=/data/mysql/db_test/conf/test.cnf --user=bkpuser --password=bkpuser --apply-log --redo-only /data/backups/full/2018-05-02_13-42-59/ /usr/local/xtrabackup/bin/innobackupex --defaults-file=/data/mysql/db_test/conf/test.cnf --user=bkpuser --password=bkpuser --copy-back /data/backups/full/2018-05-02_13-42-59/ -- 修改文件夹权限 chown -R mysql:mysql /data/mysql/db_test/data chown -R mysql:mysql /data/mysql/db_test/ulog (编辑:ASP站长网) |
相关内容
网友评论
推荐文章
热点阅读