监控发现 mysql slave 延迟了不少,登陆mysql slave 查看复制状态

mysql> show slave status\G

会有类似的错误提示 Slave:Error “Duplicate entry ‘1’ for key 1” on query…..

再查看master 的 status,验证下

mysql> show master status;

在 mysql slave 上设置

mysql> stop slave;
mysql> set global sql_slave_skip_counter=1;
mysql> start slave;

如果仍然提示错误,重复上面的步骤。

参考:
https://dev.mysql.com/doc/refman/5.6/en/set-global-sql-slave-skip-counter.html
https://dev.mysql.com/doc/refman/5.6/en/replication-options-slave.html#sysvar_sql_slave_skip_counter
https://dev.mysql.com/doc/refman/5.6/en/show-slave-status.html

相关文章:

  • 2021-09-21
  • 2022-01-09
  • 2022-01-16
  • 2021-06-07
  • 2021-08-12
  • 2022-12-23
猜你喜欢
  • 2022-01-21
  • 2021-09-17
  • 2022-12-23
  • 2022-01-15
  • 2021-11-26
  • 2021-12-02
相关资源
相似解决方案