문제

I had a MySQL slave that was running on one server, but I needed to migrate to a new server. I shut down my slave on the original server, copied the DB over to the new server and launched MySQL.

I updated the Master configuration by using Change Master To, indicating the master server name, the master_log_pos (the same value of exec_master_log_pos on the decommissioned slave), etc.

I started the slave and ran into a couple of errors:

  1. The server-id on the new slave accidentally matched the master server-id
  2. The temp folder on the new slave did not exist.

I corrected the two errors, and restarted MySQL.

In my slave status now, I no longer see any errors, but Exec_Master_Log_Pos does not increment. The Read_Master_Log_Pos keeps changing, which implies that it is receiving the master updates, but the slave does not seem to be executing the changes in the log file.

Read_Master_Log_Pos: 171716503
Exec_Master_log_Pos: 168097060

How can I force the slave to start executing the statements in the log? I've tried to stop and start the slave (both using slave start/stop and restarting mysql itself), but neither seem to have any impact.

도움이 되었습니까?

해결책

It turns out that I had a crashed table and MySQL was not able to run any updates to the slave until the table was repaired. I ran mysqlcheck -r on it, fixed the table, restarted the slave, and everything synced back up fine.

Hopefully this can help someone in the future who gets stuck on a similar problem.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top