innobackup全备

少年意气强不羁,虎胁插翼白日飞。这篇文章主要讲述innobackup全备相关的知识,希望能为你提供帮助。
###########源进行全备##############
innobackupex --defaults-file=/usr/local/mysql/etc/my.cnf --host=127.0.0.1 --port=3307 --user=root --password=******\\
--stream=xbstream --compress --compress-threads=5 . > ./bakfull_compress.xbstream
################传到从上进行解压#############
xbstream -x < ./bakfull_compress.xbstream-C ./restore/
cd ./restore
for f in ??find ./ -iname "*\\.qp"??; do qpress -dT2 $f$(dirname $f) & & rm -f $f; done

#############恢复数据###############
###########从上停止mysqld进程#######
systemctl stop mysqld3308
innobackupex --defaults-file=/usr/local/mysql3308/etc/my.cnf --use-memory=1G --apply-log ./restore
innobackupex --defaults-file=/usr/local/mysql3308/etc/my.cnf --copy-back ./restore
chown mysql:mysql -R /usr/local/mysql3308/data
systemctl restart mysqld3308
#######登录进mysql########

reset master;
set @@global.gtid_purged=0f07c648-618c-11ec-ae19-5254000aa7bf:1-2207471,
1250ceb9-b976-11ec-86ee-5254000aa7bf:1-20,
2133c30c-b977-11ec-a0e9-5254000aa7bf:1-5,
7e5451ae-b977-11ec-94ef-5254000aa7bf:1-39797;

CHANGE MASTER TO
MASTER_HOST=127.0.0.1,
MASTER_USER=repl,
MASTER_PASSWORD=123456,
MASTER_PORT=3307,
MASTER_CONNECT_RETRY=10,
MASTER_AUTO_POSITION=1;

start slave;
show slave status;
【innobackup全备】


    推荐阅读