Master節點的線程狀態 mysql> show processlist\G ERROR 2006 (HY000): MySQL server has gone away No connection. Trying to reconnect... Connection id: 4 Current database: *** NONE ***
*************************** 1. row *************************** Id: 2 User: repl Host: 192.168.78.137:42524 db: NULL Command: Binlog Dump Time: 63044 State: Master has sent all binlog to slave; waiting for binlog to be updated Info: NULL
Slave節點的線程狀態 mysql> show processlist\G *************************** 1. row *************************** Id: 2 User: system user Host: db: NULL Command: Connect Time: 62933 State: Waiting for master to send event Info: NULL *************************** 2. row *************************** Id: 3 User: system user Host: db: NULL Command: Connect Time: 62831 State: Slave has read all relay log; waiting for the slave I/O thread to update it Info: NULL
3、顯示當前有多少個Slave節點注冊到Master節點,在Master節點執行 mysql> SHOW SLAVE HOSTS; +-----------+------+------+-----------+ | Server_id | Host | Port | Master_id | +-----------+------+------+-----------+ | 200 | | 3306 | 100 | +-----------+------+------+-----------+ 1 row in set (0.00 sec)