首页 > 代码库 > 从库的线程状态

从库的线程状态

[root@localhost ~]# mysql -uroot -ppzk123 -S /data/3307/mysql.sock -e "show processlist\G;"*************************** 1. row ***************************     Id: 12   User: system user   Host:      db: NULLCommand: Connect   Time: 1299  State: Waiting for master to send event    # 从库的 I/O 线程状态   Info: NULL*************************** 2. row ***************************     Id: 13   User: system user   Host:      db: NULLCommand: Connect   Time: 1167  State: Slave has read all relay log; waiting for the slave I/O thread to update it   # 从库的 SQL 线程状态   Info: NULL

I/O 线程状态:

(1) Connecting to master :线程正视图连接主服务器
(2) Checking master version :同步服务器之间建立连接后临时出现的状态
(3) Registering slave on master :同步服务器之间建立连接后临时出现的状态
(4) Reconnecting after a fauled binlog dump request :线程正尝试重新连接主服务器
(5) Waiting for master to send event :线程已经连接上主服务器,正等待二进制 binlog 日志事件到达
(6) Queueing master event to the relay log :线程已经读取了一个事件,正将它复制到中继日志供 SQL 线程来处理
(7) Waiting to reconnect after a failed master event read :读取时出现错误,线程企图重新连接前将睡眠 master-connect-retry 秒
(8) Reconnecting after a failed master event read :线程正尝试重新连接主服务器,当重新连接建立后,状态变为 Waiting for master to send event
(9) Waiting to reconnect after a failed binlog dump request :如果二进制 binlog 日志转储请求失败,线程进入睡眠状态,然后定期尝试重新连接
(10) Requesting binlog dump :建立同主服务器之间的连接后临时出现的状态

SQL 线程状态:

(1) Reading event from the relay log :线程已经从中继日志读取一个事件,可以对事件进行处理了
(2) Waiting for slave mutex on exit :线程停止时发生的一个很简单的状态
(3) Slave has read all relay log; waiting for the slave I/O thread to update it :线程已经处理了中继日志文件中的所有事件,现在正等待 I/O 线程将新时间写入中继日志

 

 

 

    

 

从库的线程状态