基于从库+binlog方式恢复数据
将bkxt从库的全备份在rescs5上恢复一份,恢复到6306端口,用cmdb操作
恢复全备后执行如下操作
set global read_only=OFF; stop slave; reset slave all;
看xtrabackup_slave_info文件内容
分析主库上的binlog找到结束点position
/usr/local/mysql/bin/mysqlbinlog --no-defaults -vv --base64-output=DECODE-ROWS mysql-bin.000014 --start-datetime='2019-07-03 10:10:00' --stop-datetime='2019-07-03 10:15:00' > 20190703a.log
以position点12829001为例
在从库恢复到指定logfile,position上
change master to master_host='10.215.48.133',master_port=3306,master_user='repl',master_password='repl',master_log_file='mysql-bin.000013',master_log_pos=1072082757;
start slave io_thread;
start slave sql_thread until master_log_file='mysql-bin.000014',master_log_pos=12829001;
让其进行同步,稍等一会,进行查看