MySQL Slave сервер пишет: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted

Аватар пользователя admin

Полный текст ошибки обычно выглядит так:

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.

 

Такая ошибка чаще всего возникает при некорректных перезагрузках или выключениях MySQL-сервера.

Способов решения два:

  1. Перезалить базу с master'а, но это не всегда возможно и довольно долго, если база большая
  2. Выполнить следующую последовательность команд:
    STOP SLAVE;
    SHOW SLAVE STATUS;
    

    Записать значения Relay_Master_Log_File и Exec_Master_Log_Pos и далее:

    RESET SLAVE;
    CHANGE MASTER TO MASTER_LOG_FILE='имя файла из Relay_Master_Log_File',MASTER_LOG_POS=позиция_из_Exec_Master_Log_Pos;
    START SLAVE;
    

    Обычно, так делать безопасно, ведь мы устанавливаем на slave-севрере файл лога и позицию последней успешной репликации, так что никаких расхождений данных быть не должно!

0
Ваш рейтинг: Нет