1

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.

3 Answers 3

2

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.

0

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.

0

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

You must log in to answer this question.