1)基于二進(jìn)制日志復(fù)制的顯示格式
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Queueing master event to the relay log
Master_Host: 172.18.16.22
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.010362
Read_Master_Log_Pos: 555176471
Relay_Log_File: mysqld-relay-bin.004136
Relay_Log_Pos: 502564
Relay_Master_Log_File: mysql-bin.010327
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: blog
Replicate_Ignore_DB:
Replicate_Do_Table: blog.archives
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 555176471
Relay_Log_Space: 3642164873
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 1042
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1622
Master_SSL_Crl:
Master_SSL_Crlpath:
Using_Gtid: No
Gtid_IO_Pos:
參數(shù)具體含義解釋:
Slave_IO_State
這個(gè)是指Slave連接到Master的狀態(tài)邦鲫,就是當(dāng)前IO線程的狀態(tài)症汹,MySQL主從復(fù)制線程狀態(tài)轉(zhuǎn)變疹味。
Master_User
這個(gè)是Master上面的一個(gè)用戶,用來負(fù)責(zé)主從復(fù)制的用戶 纲菌,創(chuàng)建主從復(fù)制的時(shí)候建立的(具有reolication slave權(quán)限)贾陷。
Master_Port
Master服務(wù)器的端口,一般是3306卿堂。
Connect_Retry
連接嘗試次數(shù),使用change master時(shí)可以使用master-connect-retry選項(xiàng)指定當(dāng)前值懒棉。
Master_Log_File
顯示當(dāng)前I/O線程當(dāng)前正在讀取的主服務(wù)器二進(jìn)制日志文件的名稱草描,上面顯示是mysql-bin.010362。
Read_Master_Log_Pos
顯示當(dāng)前同步到主服務(wù)器上二進(jìn)制日志的偏移量策严,I/O線程已經(jīng)讀取的位置穗慕,單位是字節(jié),上述的示例顯示當(dāng)前同步到mysql-bin.010362的555176471偏移量位置妻导,即已經(jīng)同步了mysql-bin.010362這個(gè)二進(jìn)制日志中529MB(555176471/1024/1024)的內(nèi)容逛绵。
Relay_Log_File
顯示Slave的SQL線程當(dāng)前正在讀取和執(zhí)行的中繼日志文件的名稱。
Relay_Log_Pos
顯示在當(dāng)前的中繼日志中倔韭,Slave的SQL線程已讀取和執(zhí)行的中繼日志的偏移量术浪。
Relay_Master_Log_File
顯示Slave中繼日志同步到Master的二進(jìn)制日志文件,本示例中為mysql-bin.010327寿酌。
Slave_IO_Running
顯示I/O線程是否被啟動(dòng)并成功地連接到主服務(wù)器上胰苏,成功為Yes,否則為No醇疼。
Slave_SQL_Running
顯示SQL線程是否被啟動(dòng)硕并,啟動(dòng)為Yes,否則為No秧荆。
Replicate_Do_DB
Replicate_Ignore_DB
Replicate_Do_Table
Replicate_Ignore_Table
Replicate_Wild_Do_Table
Replicate_Wild_Ignore_Table
這些參數(shù)都是為了用來指明哪些庫(kù)或者表在復(fù)制的時(shí)候不要同步到備庫(kù)倔毙,但是這些參數(shù)用的時(shí)候要小心,因?yàn)楫?dāng)跨庫(kù)使用的時(shí)候可能會(huì)出現(xiàn)問題乙濒。另外當(dāng)僅忽略或僅允許多個(gè)庫(kù)或表時(shí)陕赃,要多次使用忽略語句才可以。
Last_Errno,Last_Error
顯示Slave的SQL線程讀取日志參數(shù)的的錯(cuò)誤數(shù)量和錯(cuò)誤消息琉兜,錯(cuò)誤數(shù)量為0并且消息為空字符串表示沒有錯(cuò)誤凯正;如果Last_Error值不是空值,它也會(huì)在從屬服務(wù)器的錯(cuò)誤日志中作為消息顯示豌蟋。
Skip_Counter
顯示最近被使用的用于SQL_SLAVE_SKIP_COUNTER的值廊散,就是用于跳過Slave錯(cuò)誤的。
Exec_Master_Log_Pos
表示SQL線程執(zhí)行的Relay log相對(duì)于主庫(kù)二進(jìn)制日志偏移量的位置梧疲,Read_Master_Log_Pos減去Exec_Master_Log_Pos可以表示當(dāng)前SQL線程運(yùn)行的延時(shí)允睹,單位是字節(jié)运准。上述例子顯示完全同步。注意還要看Relay_Master_Log_File的值是否跟Master_Log_File相同缭受,如果小于Master_Log_File二進(jìn)制胁澳,則說明延遲更大。
Relay_Log_Space
表示所有原有的中繼日志結(jié)合起來的總大小米者,在START SLAVE語句的UNTIL子句中指定的值韭畸,Until_Condition具有以下值:Until_Condition、Until_Log_File蔓搞、Until_Log_Pos胰丁。
Until_Condition
如果沒有指定UNTIL子句,則沒有值喂分。如果從屬服務(wù)器正在讀取锦庸,直到達(dá)到主服務(wù)器的二進(jìn)制日志的給定位置為止,則值為Master蒲祈,如果從屬服務(wù)器正在讀取甘萧,直到達(dá)到其中繼日志的給定位置為止,則值為Relay梆掸。
Until_Log_File
Until_Log_Pos
Until_Log_File和Until_Log_Pos用于指示日志文件名和位置值扬卷,日志文件名和位置值定義了SQL線程在哪個(gè)點(diǎn)中止執(zhí)行。
Master_SSL_Allowed
顯示了從服務(wù)器是否使用SSL連接到主服務(wù)器沥潭。如果允許對(duì)主服務(wù)器進(jìn)行SSL連接邀泉,則值為Yes;如果不允許對(duì)主服務(wù)器進(jìn)行SSL連接钝鸽,則值為No汇恤;如果允許SSL連接,但是從服務(wù)器沒有讓SSL支持被啟用拔恰,則值為Ignored因谎。
Master_SSL_CA_File
Master_SSL_CA_Path
Master_SSL_Cert
Master_SSL_Cipher
Master_SSL_Key
如果Slave使用SSL連接Master服務(wù)器,這里就會(huì)顯示對(duì)應(yīng)的證書和私鑰信息颜懊。使用CHANGE MASTER與SSL相關(guān)的選項(xiàng)有:–master-ca,–master-capath,–master-cert,–master-cipher和–master-key等财岔。
Seconds_Behind_Master
表示主從之間延遲的時(shí)間,單位是秒河爹。如果為null表示未知數(shù)匠璧,一般主從復(fù)制出問題了會(huì)出現(xiàn)null的情況。
Master_SSL_Verify_Server_Cert
顯示是否認(rèn)證Master證書咸这。
Master_Server_Id
顯示主服務(wù)器的Server_id夷恍。
Using_Gtid
表示是否開啟了基于Gtid的復(fù)制,開啟為Yes媳维,否則為No酿雪。
Gtid_IO_Pos
如果開啟了基于Gtid的復(fù)制遏暴,這里會(huì)顯示當(dāng)前執(zhí)行到的事物ID。
2)基于GTIDs復(fù)制的顯示格式
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.0.30.65
Master_User: mysql_slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000003
Read_Master_Log_Pos: 790
Relay_Log_File: relay-log.000008
Relay_Log_Pos: 1003
Relay_Master_Log_File: mysql-bin.000003
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 790
Relay_Log_Space: 2591
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: 5f0b7791-a499-11e6-901c-44a84227448b
Master_Info_File: mysql.slave_master_info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: 5f0b7791-a499-11e6-901c-44a84227448b:2-11
Executed_Gtid_Set: 3ec6f284-a4a8-11e6-a3fe-44a84220797c:1-4,5f0b7791-a499-11e6-901c-44a84227448b:1-11
Auto_Position: 1
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
Master_UUID
記錄Master的UUID指黎。
Master_Info_File
記錄Master info信息的存儲(chǔ)位置朋凉。
SQL_Delay
記錄Slave設(shè)置延遲復(fù)制的時(shí)間,0表示無延遲醋安。
SQL_Remaining_Delay
Slave_SQL_Running_State
記錄SQL線程的狀態(tài)杂彭。
Last_IO_Error_Timestamp
記錄最近IO線程錯(cuò)誤的時(shí)間戳。
Last_SQL_Error_Timestamp
記錄最近SQL線程錯(cuò)誤的時(shí)間戳茬故。
Retrieved_Gtid_Set
接收的二進(jìn)制日志集合盖灸,對(duì)應(yīng)IO線程。
execute_Gtid_Set
執(zhí)行的二進(jìn)制日志集合磺芭,對(duì)應(yīng)SQL線程。
Auto_Position
記錄在GTID模式下是否開啟了自動(dòng)事務(wù)校驗(yàn)醉箕。
Channel_Name
在多源復(fù)制下(5.7支持)钾腺,復(fù)制通道的名稱,可以有多個(gè)讥裤。
原文摘自:http://www.ywnds.com/?p=3826&viewuser=39