???MySQL?????????????????
???????????? ???????[ 2012/12/7 10:03:04 ] ????????
????3.5 ??????????????????????????????/dev/myvg/mydata
lvcreate -L 200M -n mysql-snap -s -p r /dev/myvg/mydata
????3.4 ?????????
mysql> unlock tables;
????3.5 ??????????????????ж?????????????
1.mount /dev/myvg/mysql-snap /mnt
2.mkdir /myback/lvm
3.cp -pR /mnt/* /myback/lvm
4.umount /mnt
5.lvremove /dev/myvg/mysql-snap
????3.6 ?????????????????????????????????????????
1.servivce mysqld stop
2.rm -R /data/mydata/*
3.cp -Rp /myback/lvm/* /data/mydata
4.service mysqld start ##??????????????????????????????????????
????3.7 ??????????????MySQL??????????mysqldump???????????ε????????????????????????????????????????????飬???????????????????λ???????????????????????mysqlbinlog???????????????????????MySQL?С?????mysqldump???????2???????
??????lvm???????????????????????????????????????????????????????????????????????????????ɡ?
???????????xtrabackup????????????????????????MySQL
????????????http://www.percona.com/software/percona-xtrabackup
????4.1 ??????xtrabackup?????????percona-xtrabackup-2.0.3-470.rhel5.i386.rpm
rpm -ivh percona-xtrabackup-2.0.3-470.rhel5.i386.rpm
????4.2 MySQL???????????????????
????4.3 ?????????????б??????????
1.mysql> create user 'percona'@'localhost' identified by 'redhat';
2.mysql> revoke all privileges??grant option from 'percona'@'localhost'
3.mysql> grant reload??lock tables??replication client on *.* to 'percona'@'localhost'
4.mysql> flush privileges;
????4.4 ???????????MySQL
innobackupex --host=locahost --user=percona --password=redhat /myback/
??????????????????/myback/???????????????????extrabackup???????е?InnoDB???MyISAM??????????????????MyISAM??MERGE??CSV??ARCHIVE???????????????????????????????????????????????????????????????????Щextrabackup????????????
????1??xtrabackup_checkpoints ?????????????????????????????????????????prepared??????LSN????????к????Χ????????InnoDB???????16k??С??????????????????к????LSN??LSN??????????????????汾?????????????LSN?????????????????η????????
????2??xtrabackup_binlog_info mysql?????????????????????????????????????????????????????????λ?á?
????3??xtrabackup_binlog_pos_innodb ??????????????????InnoDB??XtraDB??????????????????position??
????4??xtrabackup_binary ???????????xtrabackup???????????
????5??backup-my.cnf ?????????????????????????
????4.4 ??????MySQL????extrabackup?????????
1.service mysqld stop
2.rm -Rf /data/mydata
3.innobackupex --apply-log /myback/2012-12-02_20-06-12/
4.--apply-log ????????????????commit?????????????commit???????????????е??????????
5.innobackupex --copy-back /myback/2012-12-02_20-06-12/
6.--copy-back???????????????????????λ??
7.chown -R mysql:mysql /data/mydata
8.service mysqld start ##??????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11