基于全备份+binlog方式恢复数据
将bkxt从库的全备份在rescs5上恢复一份,用cmdb操作
恢复全备后执行如下操作
set global read_only=OFF; stop slave; reset slave all;
拉取主库的binlog看xtrabackup_slave_info文件内容
拉取从库的binlog看xtrabackup_binlog_info和xtrabackup_binlog_pos_innodb
本次只在主库上拉取binlog
# scp mysql-bin.000012 10.10.228.163:/data/recover2019/
分析binlog找到结束点position
/usr/local/mysql/bin/mysqlbinlog --no-defaults -vv --base64-output=DECODE-ROWS mysql-bin.000012 --start-datetime='2019-06-26 15:20:00' --stop-datetime='2019-06-26 15:50:00' > 20190626a.log
以position点945174224为例
用binlog恢复到指定position
/usr/local/mysql/bin/mysqlbinlog --no-defaults mysql-bin.000012 --start-position=918096986 --stop-position=945174224 |/usr/local/mysql/bin/mysql -ubluewhale -p -S /tmp/mysqld.5306_bkxttest.sock