Created
October 4, 2016 16:03
-
-
Save dungmanh88/8f742497ebe257625985156b5cada892 to your computer and use it in GitHub Desktop.
Backup and restore using percona xtrabackup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Backup myisam db: | |
innobackupex --user=root--password=<passwd> --host=127.0.0.1 --parallel=4 --lock-wait-timeout=180 --lock-wait-threshold=20 --lock-wait-query-type=all --kill-long-queries-timeout=20 --kill-long-query-type=all /data/backup | |
Backup innodb db: | |
innobackupex --user=root--password=<passwd> --host=127.0.0.1 --parallel=4 /data/backup | |
Backup galera: | |
innobackupex --user=root--password=<passwd> --host=127.0.0.1 --galera-info --parallel=4 /data/backup | |
Restore: | |
service mysql stop && rm -rf /var/lib/mysql/* | |
innobackupex --apply-log /data/backup/<backup-data> --use-memory=4G | |
innobackupex --copy-back /data/backup/<backup-data> --parallel=4 | |
chown -R mysql:mysql /var/lib/mysql/ && service mysql start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment