免费微网站有哪些,wordpress购物商城代码,中职学校专业建设规划,html编辑器哪个好用背景
mysql 5.7 主从复制 主库进行了一次灌数#xff0c;导致多个大事务产生#xff0c;主从延迟下不去#xff0c;经确认该表最终truncate#xff0c;并且该表仅有insert和select操作#xff0c;故对该表的事务进行跳过#xff0c;直到同步至truncate
跳过事务需谨慎导致多个大事务产生主从延迟下不去经确认该表最终truncate并且该表仅有insert和select操作故对该表的事务进行跳过直到同步至truncate
跳过事务需谨慎一定一定要谨慎
操作
总体思路就是查看备库状态到卡顿点后查看卡顿位置执行的语句是否为该表语句是则进行跳过直至追平
1查看备库状态
show slave status\G找到如下信息
Relay_Log_File: db02-relay-bin.000221
Relay_Log_Pos: 5105493822检查当前relaylog对应pos正在执行什么
mysqlbinlog --no-defaults -vvv db02-relay-bin.000221|grep -i -B 30 -A 100 510549382show relaylog events in db02-relay-bin.000221 from 510549382 limit 10 ;3确认后跳过
show slave status\G
stop slave ;
set global sql_slave_skip_counter1;
start slave;
show slave status\G4未避免因长时间stop引发的问题配置参数限制stop时间到时间后报错失败 原单位s
set global rpl_stop_slave_timeout31536000改单位s
set global rpl_stop_slave_timeout600其他
查看大事务
select * from information_schema.innodb_trx\G一切提升主备同步的设置
set global sync_binlog20;set global innodb_flush_log_at_trx_commit2;