一 错误排除
 1 mysql version
  2 mysql sql_mode
  3 binlog_format row
  4 table is innodb engine
  5 master sync_binlog = 1
  6 slave read_only = on
二 错误集锦
 1 错误问题:
    Could not execute Write_rows event on table practice.temp_baofoo_unbind; Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again, Error_code: 1197; Writing one row to the row-based binary log failed, Error_code: 1534; handler error HA_ERR_RBR_LOGGING_FAILED; the event's master log binlog.000017, end_log_pos 268602107
问题原因: 主从变量不一致
解决方式:保证主库和从库相关变量一致性
2 错误问题
  

1   复制错误:

    211122 3:42:04 [ERROR] 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
    211122 3:42:04 [Warning] Slave: Can't find record in 'history' Error_code: 1032

    错误分析

    私有云环境发生复制异常占据80%的错误,可以直接skip

2  复制错误 

    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;

3  复制错误

    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导致的,需要重做从库

    错误解决

   1   mysqldump -h --user=root --password='xxxx' --socket='/tmp/mysql.sock' --all-databases --single-transaction --triggers --routines --events --hex-blob --master-data=2 > backup.sql

   2   mysql -uroot -pxxx --socket='/tmp/mysql.sock'  < backup.sql

  3   change master to master_host='',master_user='rep',master_password='xxx',master_port=3306,master_log_file=‘',master_log_pos=;

  4  start slave

  5  show slave status\G;  输出IO_THREAD 和SQL_THREAD 都为YES即可

4  复制错误

  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;

 

相关文章:

  • 2021-09-04
  • 2021-08-19
  • 2021-10-11
  • 2021-10-20
  • 2022-03-03
  • 2021-07-29
  • 2021-05-31
猜你喜欢
  • 2022-12-23
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
相关资源
相似解决方案