简体   繁体   中英

percona replication error after shutting down the slave

We had a shutdown on slave server (at 13:47) and after that slave does not follow the master. I have all the data until the shutdown in the slave server.

Here is the slave:

mysql> show slave status \G <br>
*************************** 1. row ***************************<br>
              Master_Host: 192.168.0.56<br>
          Master_Log_File: mysql-bin.000226<br>
      Read_Master_Log_Pos: 695831819<br>
           Relay_Log_File: mysql-relay-bin.000001<br>
            Relay_Log_Pos: 4<br>
    Relay_Master_Log_File: mysql-bin.000226<br>
         Slave_IO_Running: No<br>
        Slave_SQL_Running: Yes<br>
      Exec_Master_Log_Pos: 695831819<br>
          Relay_Log_Space: 120<br>
            Last_IO_Errno: 1236<br>
            Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index file'<br>
  Last_IO_Error_Timestamp: 150709 14:26:07<br>

It seems slave receives the logs.
Actually we have "Master with Relay Slave" replication and the slave itself act as master for another slave.

How long was your slave shut down? This error message:

Could not find first log file name in binary log index file

means that the slave asked the master for binary log file mysql-bin.000226 and the master replied "Sorry, I don't know about that file anymore."

On you master type this: SHOW BINARY LOGS; Do you see the log file the slave is asking for? If not and you see others, then someone or some script removed it.

In any case, you either need to restore that binary log to the master (from a backup) or you will need to re-initialize your slave from the master using Percona XtraBackup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM