(2)在master1上查看master状态
mysql> show master status\G;
*************************** 1. row ***************************
File: mysql_bin.000001
Position: 57086958
Binlog_Do_DB: XXXXX
Binlog_Ignore_DB:
1 row in set (0.00 sec)
ERROR:
No query specified
说明:这里的Position是在跑的,不停的在变
(3)在master2上再查看proceelist:
mysql> show processlist;
+------+-------------+-----------+------+---------+------------+-----------------------------------------------------------------------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+------+-------------+-----------+------+---------+------------+-----------------------------------------------------------------------+------------------+
| 4384 | system user | | NULL | Connect | 4952 | Waiting for master to send event | NULL |
| 4385 | system user | | NULL | Connect | 4294967295 | Has read all relay log; waiting for the slave I/O thread to update it | NULL |
| 6330 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+------+-------------+-----------+------+---------+------------+-----------------------------------------------------------------------+------------------+
说明:在这里根本看不到master1用于复制的那个用户repl。
当我在master1上stop slave;start slave;之后,就可以在master2上看见repl用户了:
mysql> show processlist;
+------+-------------+-------------------+------+-------------+------+-----------------------------------------------------------------------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+------+-------------+-------------------+------+-------------+------+-----------------------------------------------------------------------+------------------+
| 4384 | system user | | NULL | Connect | 4999 | Waiting for master to send event | NULL |
| 4385 | system user | | NULL | Connect | 0 | Has read all relay log; waiting for the slave I/O thread to update it | NULL |
| 6330 | root | localhost | NULL | Query | 0 | NULL | show processlist |
| 6382 | repl | xxxxx:24541 | NULL | Binlog Dump | 3 | Writing to net | NULL |
+------+-------------+-------------------+------+-------------+------+-----------------------------------------------------------------------+------------------+
4 rows in set (0.00 sec)
但是master1上面,slave status上面的Read_Master_Log_Pos 和 Relay_Log_Space始终都没有变化。
看repl这个用于复制的用户状态是writing to net,说明正在将binlog的内容写到packet里面传到master1,但是大约80秒后,这个repl的process就消失了,再也没有了,除非在重新启动mater1的复制。这是否说明从master2传binlog的内容到master1 time out了呢?master1没有响应,3次握手失败?
我已经试过从master1和master2互相telnet,都可以建立连接的。
请高手不吝赐教啊! 作者: sissiyam 时间: 2011-6-2 15:09
自己重要找到点线索,现在可以肯定,状态只要是“writing to net”,一定是网络有问题