Xtrabackup Database Hot backup record

Source: Internet
Author: User
Tags mkdir prepare create database percona

Xtrabackup Database Hot backup record
  • Installing Xtrabackup
    • wget https://repo.percona.com/apt/percona-release_0.1-6.$(lsb_release -sc)_all.deb
    • sudo dpkg -i percona-release_0.1-6.$(lsb_release -sc)_all.deb
    • sudo apt-get update
    • sudo apt-get install percona-xtrabackup-24
  • Create DATABASE Backup user and database backup storage directory
    • Backing up user users
      • If you already have a backup user, skip to the next step
        • CREATE USER ‘bkpuser‘@‘localhost‘ IDENTIFIED BY ‘bkppassword‘;
      • Increase permissions for backup users
        • GRANT RELOAD, LOCK TABLES, REPLICATION CLIENT ON *.* TO ‘bkpuser‘@‘localhost‘;
        • flush privileges;
    • Create a storage directory
      • mkdir -p /home/dw/backup/fullbak
      • mkdir -p /home/dw/backup/incbak
  • Full backup
    • innobackupex --user=dw --password=123 --no-timestamp path_to_fullbak;
  • Incremental backup
    • innobackupex --user=dw --password=123 --no-timestamp --incremental path_to_increbak --incremental-basedir=which_backup_to_base;
    • Note that each incremental backup needs to specify the increment it is based on which backup to make, either for a full backup or for the previous incremental backup
  • Data Recovery
      • Backup prepare
        • full backup restore
        • innobackupex--apply-log--red O-only Path_to_fullbak;
        • Incremental backup restore
        • Innobackupex--apply-log--redo-only path_to_fgullbak--incremental-dir=path_to_each_increbak;
        • Note that the prepare of the last backup does not require a--redo-only parameter
      • Backup Restore
        • shut down the MySQL service before executing the RESTORE command, and empty the MySQL data_dir
        • innobackupex--copy-back Path_to_fullbak;
        • After
        • is complete, first chown-r mysql:mysql/data_dir, and then restart the MySQL service
      • The increment for
      • recovery binlog
        • Xtrabackup is performed periodically, so to recover data from either node, you must use Binlog restore
        • in the last incremental folder to view Xtrab Ackup_binlog_info, gets the Binlog file and Stop-pos
        • mysqlbinlog--no-defaults Abs_path_to_binlog at the time of the last incremental backup-- Start-position=pos | MYSQL-UDW Recover all data

Xtrabackup database Hot backup record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.