What I do when a replicated database slave's relay log partition has filled up
You have a replicated database but the slave’s relay log partition has filled up (probably because Ubuntu default partitioning has /var/log in its own partition). You now have a broken slave with corrupt logs. What do you do?
- Move relay log file position (it’s the
relay-logsetting) inmy.cnfand restart MySQL. - Open a MySQL root client (
# mysql -u root -p) - Run
SHOW SLAVE STATUS\Gto get the currentExec_Master_Log_PosandMaster_Log_File - Use
CHANGE MASTER TOand set theMASTER_LOG_FILEandMASTER_LOG_POSto the settings from #3. - Run
START SLAVE;to get things going again.
This works because of this piece of documentation:
CHANGE MASTERdeletes all relay log files and starts a new one, unless you specifyRELAY_LOG_FILEorRELAY_LOG_POS. In that case, relay logs are kept; therelay_log_purgeglobal variable is set silently to 0.
It’s not Ruby, but it is Rails; not everything in Rails is programming.








