mysql 跳过同步错误sql_slave_skip_counter
来源:互联网 发布:网络词木马是什么意思 编辑:程序博客网 时间:2024/05/18 02:42
最近MySQL 遇到了同步问题,现整理一下常遇到的错误应急的解决方法,备用。
下边是应急方法,不在乎数据一致性。数据一致性要求高的不要用。或者临时用,记录下发生错误的表,等到业务不高时在进行数据表校验修复(修复方式请参见最后链接地址)。
方法一:手动设置动态参数 sql_slave_skip_counter
stop slave sql_thread;set global sql_slave_skip_counter=1;start slave sql_thread;
这个要 根据具体的错误来判定,一般用于主键冲突或者更新失败错误,进行手动跳过。
方法二:静态服务器设置,需要重启mysql
[mysqld]
slave_skip_errors=1032,1062
重启MySQL之后,会自动加载配置文件,同步自动跳过更新,与主键冲突错误。
参数说明:
Normally, replication stops when an error occurs on the slave.
This gives you the opportunity to resolve the inconsistency in the data manually.
This variable tells the slave SQL thread to continue replication when a statement returns any of the errors listed in the variable value.
slave_exec_mode
这个比较狠
set global slave_exec_mode =strict;
严格执行策略。大多数情况下遇到错误,同步就会终止。等待错误解决。
set global slave_exec_mode =idempotent;
这个设置,可以允许同步跳过
duplicate-key and no-key-found错误
四、如果数据缺失严重,而且数据量很少的情况下,直接重做主从。
对于数据一致性要求较高的场合:主要针对1032(从库数据缺失)和1062主键冲突的错误、1452外键问题。参见下面链接
参看网址:http://www.linuxidc.com/Linux/2017-02/141059.htm
http://mp.weixin.qq.com/s/nRHk_idbH2xZPXepRolW9Q
- mysql 跳过同步错误sql_slave_skip_counter
- 跳过mysql主从同步错误
- MySQL 跳过同步错误方法
- mysql同步GLOBAL sql_slave_skip_counter解释
- MySQL的一次错误处理 SQL_SLAVE_SKIP_COUNTER
- mysql主从复制跳过错误
- mysql主从复制跳过错误
- mysql主从复制跳过错误
- mysql主从复制跳过错误
- mysql主从复制跳过错误
- mysql gtid 复制跳过错误
- mysql复制出错与sql_slave_skip_counter
- perl 批量跳过 mysql slave 复制错误
- 批量跳过mysql slave错误小脚本
- mysql GTID主从复制 跳过复制错误
- mysql开启GTID跳过错误的方法
- mysql 同步错误总结
- mysql主从同步错误
- 手动添加jar包到本地仓库
- modal模态框的实现
- ubuntu 安装qemu
- n皇后 位运算
- 进一步理解!linux下bus,device,driver三者关系
- mysql 跳过同步错误sql_slave_skip_counter
- c++ const
- 数据结构——基本概念
- 第五章 文件系统的系统调用
- HDU 1251 统计难题(经典字典树)
- LA 4329 Ping pong [树状数组]
- SSM框架整合中遇到的问题汇总
- 大学本科《机器人程序设计课程》配套系统镜像使用说明( Ubuntu 14.04.5 + ROS indigo )
- HBuilder学习过程中遇到的问题