1.1.1.1 Introduce Distinguish: Innobackupex-1.5.1 has backed up all database files 【Including form definition file, data file, index file 】 Xtrabackup only backs up the data file of InnoDB form --Tablename.ibd file, so we need to back up the database structure of the form definition file or dump alone, it otherwise not appear can delete by the situations of the catalogues data by mistake on ...uh ...It uncertain to on it is newly After install XtraBackup, you will see below tools: /usr/bin/innobackupex-1.5.1 /usr/bin/tar4ibd /usr/bin/xtrabackup xtrabackup - binary, which allows to copy only InnoDB/XtraDB tablespaces innobackupex - script, based on innobackup Perl script, distributed by Oracle/InnoDB under GPL license. Script was modified to work with xtrabackup binary and accept new parameters. Script provides functionality to backup whole MySQL database instance with MyISAM, InnoDB, XtraDB tables. 1.1.1.2 Download1.1.1.3 Installrpm -Uvh MySQL-client-community-5.0.91-1.rhel4.x86_64.rpm rpm -Uvh xtrabackup-1.2-13.rhel4.x86_64.rpm [url=]1.1.1.4 Backup[/url][e1] 1.
Using innobackupex-1.5.1 backup all databases. ms@adm76:~/bakcup> innobackupex-1.5.1 --user=root --stream=tar /opt/ms/soft/xtrabackup/backup/ --slave-info --use-memory=256M --host=127.0.0.1 --port=4309 --socket=/tmp/mysqlbk.sock --defaults-file=/opt/ms/mysqlbk/my.cnf --no-lock | gzip > /opt/ms/soft/xtrabackup/backup/bak_mysql_20100628_1750.tar.gz InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy. All Rights Reserved. xtrabackup: Target instance is assumed as followings. xtrabackup:
innodb_data_home_dir = /opt/ms/mysql5140/Idata xtrabackup:
innodb_data_file_path = ibdata1:10M:autoextend xtrabackup:
innodb_log_group_home_dir = /opt/ms/mysql5140/Idata/ilog xtrabackup:
innodb_log_files_in_group = 3 xtrabackup:
innodb_log_file_size = 268435456 xtrabackup: Stream mode. >> log scanned up to (26586735764) 100612 15:32:33
innobackupex-1.5.1: Continuing after ibbackup has suspended innobackupex-1.5.1: Starting to backup InnoDB tables and indexes innobackupex-1.5.1: from original InnoDB data directory '/opt/ms/mysql5140/Idata' innobackupex-1.5.1: Backing up as tar stream 'ibdata1' innobackupex-1.5.1: Backing up files '/opt/ms/mysql5140/var/adm/*.ibd' (42 files) innobackupex-1.5.1: Backing up file '/opt/ms/mysql5140/var/test/test.ibd' >> log scanned up to (26587796751) ... ... 100612 15:34:41
innobackupex-1.5.1: Starting to backup .frm, .MRG, .MYD, .MYI, innobackupex-1.5.1: .TRG, .TRN, .ARM, .ARZ and .opt files in innobackupex-1.5.1: subdirectories of '/opt/ms/mysql5140/var' innobackupex-1.5.1: Backing up files '/opt/ms/mysql5140/var/adm/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,opt,par}' (52 files) innobackupex-1.5.1: Backing up file '/opt/ms/mysql5140/var/test/test.frm' innobackupex-1.5.1: Backing up file '/opt/ms/mysql5140/var/test/tt.frm' innobackupex-1.5.1: Backing up files '/opt/ms/mysql5140/var/mysql/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,opt,par}' (65 files) innobackupex-1.5.1: Backing up files '/opt/ms/mysql5140/var/report/*.{frm,MYD,MYI,MRG,TRG,TRN,ARM,ARZ,opt,par}' (71 files) 100612 15:34:42
innobackupex-1.5.1: Finished backing up .frm, .MRG, .MYD, .MYI, .TRG, .TRN, .ARM, .ARZ and .opt files innobackupex-1.5.1: Backup created in directory '/opt/ms/backup' innobackupex-1.5.1: MySQL binlog position: filename 'mysql-bin.000037', position 140471897 innobackupex-1.5.1: MySQL slave binlog position: master host '10.0.9.79', filename 'mysql-bin.000040', position 162029822 innobackupex-1.5.1: You must use -i (--ignore-zeros) option for extraction of the tar stream. 100612 15:34:46
innobackupex-1.5.1: completed OK! 2.
Using xtrabackup backup InnoDB data. 1.1.1.5 Restore1.
Uncompress tar.gz file tar -ixvf bak_mysql_20100628_1750.tar.gz 2.
Restore DB innobackupex-1.5.1 --apply-log /opt/ms/soft/xtrabackup/backup innobackupex-1.5.1 --copy-back /opt/ms/soft/xtrabackup/backup or innobackupex-1.5.1
--socket=/tmp/mysql9999.sock --defaults-file=/opt/mysql/my.cnf
--no-lock
--apply-log /opt/slave innobackupex-1.5.1 --user=adm --password=adm
--host=localhost --port=3306 --socket=/tmp/mysql9999.sock --defaults-file=/opt/mysql/my.cnf
--copy-back /opt/slave 3.
Recovery DB Using binary logs recovery DB mysqlbinlog --start-position=3335 mysql-bin.000003 |mysql -uroot -P3309 test 1.1.1.6 Result1.
Backup smooth, impact DB lowest 2.
After restore DB, can use binary logs to recovery DB. 3.
Can recovery to point time. 1.1.1.7 Positive1.
Can compress backup file while backup, so it’s occupy fewer storage 2.
Support increment backup 3.
Need lower CPU 1.1.1.8 Negative1.
After backup innodb data, need to backup .frm more 2.
When encounter err need buy support or research the code.
[e1]backup restore verify
|