Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Our Slave Server disk drive got full, replication stopped, so we cleared space off, and started replication again. Well, all was good until we ran into a corrupt relay bin file on the slave (used mysqllogbin to insure).

What do we do? Can we remove the corrupt bin file, and restart, hoping it will rebuild that file?

Little lost on what to do, any help would be great.

We are running 5.1, have a master, and a slave.

I may be missing info, or not being clear enough, if so, let me know and I can fill you in.

share|improve this question

2 Answers 2

up vote 3 down vote accepted
SHOW SLAVE STATUS\G

Record the values shown for Relay_Master_Log_File and Exec_Master_Log_Pos, which show the last position from the master's binary logs that executed successfully.

Use CHANGE MASTER to cause the slave to copy the binary log from that point on again, replacing the relay logs with fresh ones:

STOP SLAVE;
CHANGE MASTER TO 
  master_log_file='<Relay_Master_Log_File>', 
  master_log_pos=<Exec_Master_Log_Pos>;
  -- replace those two tags with the values you recorded earlier
START SLAVE;
share|improve this answer

You can try and skip 1 record if that is corrupted. You can do this by doing:

set global sql_slave_skip_counter=1; start slave;

then do

show slave status\G

and see if its ok.

You can repeat this a few times until it starts replicating properly.

If on the other hand, you feel you lost too much data and the slaves are out of sync, then you can do a new mysqldump of the master to resync them.

Lastly, maatkit has a syncing tool that will do a checksum on both tables and will try to sync them for you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.