soupdiver
soupdiver

Reputation: 3673

Mysql replication slave does not catch the master

2 days ago I started to set up y MySQL master - slave replication. I did the export form the master and imported it on the slave and all this stuff. This all just worked fine. But I had some trouble with setting up the connection from the slave to the master. So I stopped working on it in the night. Now around 1.5 days later I fixed the problem and my replication is running. The master was running all the time. But now when i run show slave status I'm ~125,000 seconds behind the master. I thought the slave will automatically download all the logged stuff from the master and will run this stuff so that they are in sync. But the value of seconds_behind_master just gets lower very slow. Is this normal? Is there a way to push all the stuff from the last 1.5 days immediately or did I something very wrong?

Upvotes: 1

Views: 2996

Answers (2)

user3770071
user3770071

Reputation: 1

This is regarding that MySQL slave is not catch up master and over the time periods it will have more lag or slave server behind the master. The only one solution for this situation kindly check error log of slave and advised to start MySQL slave replication at that position and bin-log. Here position is exact for change master command.

  • if you not found any position with error log file than try to get bin-log convert to text file and find proper date and time when master been lost its connection and cross check with slave server which entry was last inserted in slave and confirm with position then use change master to command.

or

  • change your [master server as slave server] and [slave server as master] and try to get replication again then all well with reverse replication and after you will have changed to original architecture. It will work definitely.

Upvotes: 0

Vatev
Vatev

Reputation: 7590

The slave would execute the binary log in a single thread as fast as it can. Depending on your servers configuration and the load on the master it is possible the slave will take a lot of time to catch up (or even lag behind even more in some cases).

Upvotes: 2

Related Questions