诊断 Mysql 复制问题

the*_*ive 5 mysql mysql-replication

我们有一个 mysql 复制客户端在我们的备份服务器上运行。由于上周停电,它停止了复制。在此之前,它不间断地运行了几个月。

我试过重新启动主机和从机,但这没有帮助。我可以从从属服务器访问主服务器,所以网络不是问题。

我还能做些什么来尝试诊断问题所在?

mysql> show slave status\G;
*************************** 1. row ***************************
             Slave_IO_State:
                Master_Host: master
                Master_User: username
                Master_Port: 3306
              Connect_Retry: 60
            Master_Log_File: mysql-bin.000060
        Read_Master_Log_Pos: 46277494
             Relay_Log_File: mysqld-relay-bin.000348
              Relay_Log_Pos: 98
      Relay_Master_Log_File: mysql-bin.000060
           Slave_IO_Running: No
          Slave_SQL_Running: Yes
            Replicate_Do_DB:
        Replicate_Ignore_DB:
         Replicate_Do_Table:
     Replicate_Ignore_Table:
    Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
                 Last_Errno: 0
                 Last_Error:
               Skip_Counter: 0
        Exec_Master_Log_Pos: 46277494
            Relay_Log_Space: 98
            Until_Condition: None
             Until_Log_File:
              Until_Log_Pos: 0
         Master_SSL_Allowed: No
         Master_SSL_CA_File:
         Master_SSL_CA_Path:
            Master_SSL_Cert:
          Master_SSL_Cipher:
             Master_SSL_Key:
      Seconds_Behind_Master: NULL
1 row in set (0.00 sec)

ERROR:
No query specified


mysql> show master status\G;
*************************** 1. row ***************************
            File: mysql-bin.000069
        Position: 851796
    Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)

ERROR:
No query specified
Run Code Online (Sandbox Code Playgroud)

更新:错误进入 daemon.log,而不是 mysql.err,这可以解释为什么我找不到它们。问题似乎是 master 说日志不可用,这没有多大意义,因为该日志(和前一个)在 master 上仍然可用。

090710  9:17:35 [Note] Slave SQL thread initialized, starting replication in log 'mysql-bin.000060' at position 46277494, relay log './mysqld-relay-bin.000350' position: 98
090710  9:17:35 [Note] Slave I/O thread: connected to master 'username@master:3306',  replication started in log 'mysql-bin.000060' at position 46277494
090710  9:17:35 [ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( server_errno=1236)
090710  9:17:35 [ERROR] Got fatal error 1236: 'Client requested master to start replication from impossible position' from master when reading data from binary log
090710  9:17:35 [Note] Slave I/O thread exiting, read up to log 'mysql-bin.000060', position 46277494
Run Code Online (Sandbox Code Playgroud)

wom*_*ble 7

欢迎来到精彩的 MySQL 复制世界。我自己还没有遇到您的特定问题,但我遇到了许多其他奇怪的问题,最接近的解决方案是从 master 重新同步,就好像它是一个全新的 slave 并完成它。

  • 生命太短暂了,无法确切地*为什么* MySQL 决定在这个特定时间破坏您的周末。踢它然后回到电影中。 (6认同)