mysql系列~复制异常

1 错误代码:-1032
   错误信息: Slave SQL: Could not execute Delete_rows event on table zabbix.history; Can't find record in 'history', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.003228, end_log_pos 435659530, Error_code: 1032
                  [Warning] Slave: Can't find record in 'history' Error_code: 1032
   错误分析:delete/update 无法找到记录
   修复手段:根据记录分析出具体的缺失记录手动插入即可
2 错误代码:-1062
   错误信息: Duplicate entry ‘…’ for key 'PRIMARY
   错误分析:insert 重复记录
   修复手段:根据主键删除重复记录
3 复制错误:-1256
   错误信息: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running      'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
   错误分析: 由于服务器异常重启导致的错误,需要重新指定
   错误解决 stop slave; && CHANGE MASTER TO MASTER_LOG_FILE=Relay_Master_Log_File,MASTER_LOG_POS=Exec_Master_Log_Pos; && start slave;
4 复制错误:-1236
   错误信息: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index
   错误分析: 由于mysql主库缺少从库所需要的binlog导致的,需要重做从库
   错误解决:从新搭建从库
5 复制错误:-1236
  错误信息: Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master
  错误分析: mysql 主节点binlog被截断,可能由多种原因,比如磁盘满 异常重启等
  错误解决: stop slave; && CHANGE MASTER TO MASTER_LOG_FILE=Relay_Master_Log_File+1,MASTER_LOG_POS=0; &&start slave;
6 复制错误:
  错误信息: Error writing file '/tmp/MYYEBa32' no space /tmp
  错误分析: 从库/tmp目录打满
  错误解决: 调整mysql tmpdir=/mnt/sdc/mysql_tmp 重启mysql服务

7 复制错误
错误信息 A slave with the same server_uuid/server_id as this slave has connected to the master;
错误分析 由于使用了相同的server-id导致的
问题解决 1 搭建新从库 拷贝了data目录一定要删除auto.cnf文件
                2 修改my.cnf的server-id文件

8  复制错误

  错误信息: waiting for slave workers to process their queues  复制进程正常,但是位点信息不变

  错误分析:  error.log出现大量回滚事务,卡主的表出现太多唯一索引,并行回放的时候导致事务不断等待

  问题解决 1 stop slave 此操作需要时间比较长,需要等待哈,个人经验几分钟

                 2 设置 slave_parallel_workers=1 相当于关掉了并行复制

                3  start slave

  

posted @   开心的蛋黄派  阅读(269)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
历史上的今天:
2020-04-05 python-基础算法构建
点击右上角即可分享
微信分享提示