我们有一个 MySQL 设置,运行一个主服务器和两个复制从服务器。我们最近遇到了一种情况,其中一个复制从站上的 SlaveIO 已停止,而另一个复制从站上的 SlaveSQL 已停止。这已经悄然停止了两台从属服务器上的复制。
我决定为Nagios编写一个监控插件来监视SlaveIO和SlaveSQL的状态。我遇到的问题是模拟我们上面遇到的场景。我可以发出“STOP SLAVE”命令来停止 SlaveIO 和 SlaveSQL,但我想单独停止每个命令以确保脚本正确反应。
这可能吗?
We have a MySQL setup running a single master and two replication slaves. We recently ran into a scenario where SlaveIO had stopped on one of the replication slaves and SlaveSQL had stopped on the other replication slave. This had silently stopped replication on both slave servers.
I decided to write a monitoring plugin for Nagios to keep an eye on the status of SlaveIO and SlaveSQL. The problem I am having is emulating the scenarios we ran into above. I can issue a "STOP SLAVE" command to stop both SlaveIO and SlaveSQL, but I would like to stop each individually to be sure the script reacts correctly.
Is this possible?
发布评论
评论(1)
尝试 SLAVE STOP SQL_THREAD 和 SLAVE STOP IO_THREAD
参见“暂停从属设备上的复制”。
Try
SLAVE STOP SQL_THREAD
andSLAVE STOP IO_THREAD
See “Pausing Replication on the Slave” in the MySQL manual.