重启mysql从库
http://www.jonathanlevin.co.uk/2010/05/how-to-safetly-restart-your-mysql-slave.html
How to Safetly Restart Your MySQL Slave Server
- Make sure that nothing can access it
(take it off the load balancer). - in mysql client do: STOP SLAVE;
- in mysql client do: FLUSH TABLES;
(if it gets stuck here, then you might need to fix it. You can try UNLOCK TABLES.) - in command line do: /etc/init.d/mysql stop
...do your what you need to do here...
- in command line do: /etc/init.d/mysql start
(check for errors, sometimes in my.cnf) - in mysql client do: START SLAVE;
(normally this would be done automatically when you restart mysql) - in mysql client do: SHOW SLAVE STATUS\G
(check that replication is working properly) - After you are satisfied, set up the slave server back on the load balancer
http://dba.stackexchange.com/questions/5528/rebooting-a-mysql-replication-slave

For the first time since it was set up I need to reboot a read-only MySQL replication slave. I found this article about downing a slave for maintenance (albeit he's just describing stopping the In summary the procedure is: In
From OS:
I would reboot at this point and then after the system has booted: In
Does this look about right? Is there anything else I should be doing? |
|||||
|
This looks right. The slave will pick up where it left off when it starts back up. I will note that unless you supply the --skip-slave-start option, the slave should start automatically. |
|||||||||
|