We were running out of the disk space on slave because of relay-bin files, so I stopped the mysql server, deleted the relay-bin files. changed my.cnf file to point the relay log to another location. In Slave status, I noted the 'Relay_Master_Log_File' and 'Exec_Master_Log_Position'. I used them to 'Change Master'. It doesn't work. I get at the prompt, It says Failed to open the relay-log at the old position. How Mysql is still looking at the old files, and how I can change it?

Thanks.

link|improve this question
feedback

5 Answers

You should have originally deleted the logs by issuing RESET SLAVE.

Still, if you:

  • Are happy with the consistency of the slave's data to-date.
  • You have a record of Exec_Master_Log_Position and the corresponding log filename.
  • The master still has the logs which correspond to this log position and filename.

Issue STOP SLAVE and RESET SLAVE. This will remove all replication related information from the slave including relay-log.info which is likely to be causing the error you see.

Use CHANGE MASTER .. to reconfigure the slave with your log position, host, username, etc.

Then kick it back up with START SLAVE.

link|improve this answer
feedback

To get it working right away, your best bet may be to : mysqldump --master-data --databases db_name > snapshot20091124.sql and scp it over to your replication slave. You can double check the log position by paging through the first few lines of the mysql dump. issue a "stop slave;" , do an import "mysql -u root -p < snapshot20091124.sql", then issue a "start slave". Replication is a sometimes needlessly complicated beast.

link|improve this answer
feedback

Try to restart your slave server to flush out the cache.

link|improve this answer
feedback

Here you go

http://onaxer.com/blog/blog/2010/11/13/how-to-fix-corrrupted-relay-log/

It will fix your issue

link|improve this answer
feedback

it seems that your mysql needs repair. however, i completely agree with the Dan Carley Answer to your question and i think it is sufficient for resolving your mysql issue but still if you encounter the same error you should first repair your MySQL database using MySQL repair tool. This will surely resolve the issue. . . thx

link|improve this answer
feedback

Your Answer

 
or
required, but never shown