I've got a new MySQL replication setup with one master and one slave.
In all of the following scenarios, the slave automatically reconnects to the master and resumes replication where it left off:
- mysql service is restarted on the slave host
- Slave host is rebooted
- mysql service is restarted on the master host (reconnection happens after the default 60-second slave I/O reconnect timeout)
However, if I try rebooting the master host, the mysql service on the slave host neither detects that the master went down nor resumes replication when the master becomes available again. In this scenario:
- I see no entries in the mysql error log on the slave host
show slave hosts;on master (once it comes back up) shows no hosts connected
UPDATE: Looking more closely at the mysql errors logs on the master, I suspect that the master is not completing a clean shutdown because when stopping the service I see the logs:
2013-07-29 17:43:45 5281 [Note] /usr/sbin/mysqld: Normal shutdown 2013-07-29 17:43:45 5281 [Note] Giving 1 client threads a chance to die gracefully [snip] 2013-07-29 17:43:48 5281 [Note] InnoDB: Shutdown completed; log sequence number 146430781066 [snip] 2013-07-29 17:43:48 5281 [Note] Shutting down plugin 'binlog' 2013-07-29 17:43:48 5281 [Note] /usr/sbin/mysqld: Shutdown complete 130729 17:43:48 mysqld_safe mysqld from pid file /opt/mysql/run/mysqld.pid ended
...while after rebooting, the mysql error log on master ends with:
2013-07-29 17:46:58 6441 [Note] InnoDB: Starting shutdown...
...and is missing the
Shutdown complete message.