mk-slave-find - 顾名思义,根据master查找slave。安装方法查看这里。
在mysql5.1里查看一个master有哪些slave可以通过PROCESSLIST系统表查出:

mysql> select HOST from information_schema.PROCESSLIST where STATE like ‘%slave%’;
+——————+
| HOST             |
+——————+
| 192.168.1.2:44846 |
| 192.168.1.3:33022 |
| 192.168.1.4:50836 |
| 192.168.1.5:32769 |
| 192.168.1.6:33113 |
| 192.168.1.7:33005 |
| 192.168.1.8:32786 |
| 192.168.1.9:32862 |
+——————+
11 rows in set (0.00 sec)

在5.1之前想查出有哪些slave比较麻烦,比较直接的就是直接通过show processlist把所有进程列出,在去刷选查出:

show processlist;
+———–+———-+——————+———–+————-+———-+—————————————————————-+——————+
| Id        | User     | Host             | db        | Command     | Time     | State                                                       | Info             |
+———–+———-+——————+———–+————-+———-+—————————————————————-+——————+
|      1211 | slave2 [...]