Xtrabackup full backup

来源:互联网 发布:网络招聘文员好做吗 编辑:程序博客网 时间:2024/05/22 03:53

Step:

create full backup:
innobackupex --defaults-file=/etc/my.cnf --user=root --password=mysql /tmp/backup

shutdown mysql:
mysqladmin -uroot -p'mysql' -S /tmp/mysql.sock shutdown


prepare:
innobackupex --defaults-file=/etc/my.cnf --apply-log --redo-only /data/backup/full/2011-06-17_12-04-51 --user=root --password='mysql'

recover:
innobackupex --defaults-file=/etc/my.cnf --copy-back /tmp/backup


startup mysql:
mysqld_safe --defaults-file=/etc/my.cnf &

 

NOTES:

[root@SLAVE bin]# innobackupex --defaults-file=/etc/my.cnf --copy-back /tmp/backup

InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2012.  All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the copy-back run completes successfully.
           At the end of a successful copy-back run innobackupex
           prints "completed OK!".

sh: xtrabackup: command not found
innobackupex: fatal error: no 'mysqld' group in MySQL options
innobackupex: fatal error: OR no 'datadir' option in group 'mysqld' in MySQL options

SOLUTION:

ln -s /tmp/xtrabackup-1.6.5/mysql-5.1/storage/innobase/xtrabackup/xtrabackup_51 /usr/local/mysql/bin/xtrabackup