mysql主从复制错误

在主从复制中,经常会遇到重复主键的错误,这种错误如果是一个个的skip,重复的值多了的情况下,会很麻烦,可以在配置文件中设置slave_skip_errors参数跳过某一类的错误,但是需要重启实例,也不是很合适,还可以设置slave_exec_mode这个参数
Controls how a slave thread resolves conflicts and errors during replication. IDEMPOTENT mode causes suppression of duplicate-key and no-key-found errors. This mode should be employed in multi-master replication, circular replication, and some other special replication scenarios. STRICT mode is the default, and is suitable for most other cases.

This mode is needed for multi-master replication, circular replication, and some other special replication scenarios for MySQL Cluster Replication. (See Section 18.6.10, “MySQL Cluster Replication: Multi-Master and Circular Replication”, and Section 18.6.11, “MySQL Cluster Replication Conflict Resolution”, for more information.) The mysqld supplied with MySQL Cluster ignores any value explicitly set for slave_exec_mode, and always treats it as IDEMPOTENT.

In MySQL Server 5.6, STRICT mode is the default value. This should not be changed; currently, IDEMPOTENT mode is supported only by NDB and is used when replicating NDB to InnoDB.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值