zoukankan      html  css  js  c++  java
  • innobackupex 使用说明

    1、创建备份相关用户

    create user 'backuper'@'127.0.0.1' identified by '123456';
    grant reload,lock tables,replication client,process,super on *.* to 'backuper'@'127.0.0.1';
    grant create,insert,select on percona_schema.xtrabackup_history to 'backuper'@'127.0.0.1';
    
    create user 'backuper'@'localhost' identified by '123456';
    grant reload,lock tables,replication client,process,super on *.* to 'backuper'@'localhost';
    grant create,insert,select on percona_schema.xtrabackup_history to 'backuper'@'localhost';

    2、创建全备

    innobackupex --user=backuper --password=123456 --host=127.0.0.1 --port=3306 /tmp/backup/
    

    3、创建增备

    innobackupex --user=backuper --password=123456 --host=127.0.0.1 --port=3306 --incremental --incremental-basedir=/tmp/backup/2016-09-07_04-14-17 /tmp/backup_incremental

    4、在全备上前滚日志

    innobackupex --apply-log --redo-only /tmp/backup/2016-09-07_04-14-17 

    5、在增备上前滚&回滚日志

    innobackupex --apply-log --incremental-dir=/tmp/backup_incremental/2016-09-07_04-22-36 /tmp/backup/2016-09-07_04-14-17 

    6、把处于一致的备份复制到datadir目录下

    innobackupex --defaults-file=/etc/my.cnf --copy-back /tmp/backup/2016-09-07_04-14-17 

    7、调整数据的属主,属组 & 启动mysql服务

    chown -R mysql:mysql /usr/local/mysql/data
    service mysqld start

    8、以single-file的方式来备份数据库

    innobackupex --user=backuper --password=123456 --host=127.0.0.1 --port=3306 --stream=xbstream /tmp >/tmp/backup/mysql_3306_full.xbstream

    9、把单文件解包成文件夹

    xbstream -x < /tmp/backup/mysql_3306_full.xbstream -C /tmp/datadir

    10、前滚&回滚日志

    innobackupex --apply-log --use-memory=2G /tmp/datadir

    11、把处于一致的备份复制到datadir目录下

    innobackupex --defaults-file=/etc/my.cnf --copy-back /tmp/datadir
  • 相关阅读:
    Java中的import
    C语言中变量的理解
    C语言中变量的储存类别
    android通话流程浅析RIL层
    IOS(数据持久化1)
    IOS(CGContent画曲线)
    IOS XML的类型数据的解析
    truncate narrow string converted from unicode string
    复习:C语言中的转义字符
    Note of using static_cast
  • 原文地址:https://www.cnblogs.com/JiangLe/p/5847081.html
Copyright © 2011-2022 走看看