- 论坛徽章:
- 0
|
我用nagios check_mysql监控mysql主从同步的数据库
经常会有n多在 mysql> show processlist;
时nagios账户采集时用的 show slave status 无法返回值的问题,这时登陆进mysql 也无法使用其他命令,只能重启
|
mysql> show processlist;
+-----+-------------+-----------------------+------+-------------+------+-----------------------------------------------------------------------+-------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+-------------+-----------------------+------+-------------+------+-----------------------------------------------------------------------+-------------------+
| 221 | system user | | NULL | Connect | 6243 | Has read all relay log; waiting for the slave I/O thread to update it | NULL |
| 355 | root | 218.21.53.12:36271 | amp | Query | 4691 | Killing slave | slave stop |
| 356 | nagios | 218.21.55.14:55919 | NULL | Query | 4690 | NULL | show slave status |
| 357 | nagios | 218.21.55.14:56883 | NULL | Query | 4621 | NULL | show slave status |
| 358 | nagios | 218.21.55.14:57746 | NULL | Query | 4550 | NULL | show slave status |
| 359 | nagios | 218.21.55.14:58580 | NULL | Query | 4480 | NULL | show slave status |
| 360 | nagios | 218.21.55.14:51058 | NULL | Query | 4410 | NULL | show slave status |
mysql> start slave;
Ctrl-C -- sending "KILL QUERY 447" to server ...
Ctrl-C -- query aborted.
Ctrl-C -- sending "KILL 447" to server ...
Ctrl-C -- query aborted.
Ctrl-C -- exit!
Aborted
只能强制重启mysql
100509 22:14:54 [Note] Slave I/O thread killed while reading event
100509 22:14:54 [Note] Slave I/O thread exiting, read up to log 'localhost-bin.000058', position 843266790
100509 22:14:54 [Note] Error reading relay log event: slave SQL thread was killed
100509 22:15:00 [Note] Slave SQL thread initialized, starting replication in log 'localhost-bin.000058' at position 843266790, relay log './localhost-relay-bin.000071' position: 103377385
100509 22:15:00 [Note] Slave I/O thread: connected to master 'back@218.21.53.12:3306',replication started in log 'localhost-bin.000058' at position 843266790
100509 22:15:05 [Note] Slave I/O thread killed while reading event |
|