主库运行show master status可以看到当前二进制日志的信息,如:
Binlog_Do_DB:由数据库参数binlog_do_db列出的数据库填充。
Binlog_Ignore_DB:由数据库参数binlog_ignore_db填充,如果以上任何配置中都不存在值,那么所有数据库中的写入活动都会被列入二进制日志中。
Executed_Gtid_Set:是MySQL5.6.6的新特性,显示在主库上执行全局事务标识符
在从库上执行show slave status
Master_Log_File:从库I/O线程正在读取的当前二进制日志的名称
Read_Master_Log_Pos:当前主库二进制日志已经被从库I/O线程读取到的位置
Relay_Log_File:线程中正在读取的中继日志的位置
Relay_Log_Pos:被从库线程读取并执行的当前中继日志的位置
Relay_Master_Log_File:记载了包含最近一个被从库SQL线程执行的事件的二进制文件的位置
Slave_IO_Running:用来说明从库服务器是否已经连接到主库,三个值:是,否,正在连接
Slave_SQL_Running:shuom SQL线程是否正在运行
点击(此处)折叠或打开
- mysql> show master status \G
- *************************** 1. row ***************************
- File: mysql-bin-3306.000009
- Position: 35946018
- Binlog_Do_DB:
- Binlog_Ignore_DB:
- Executed_Gtid_Set:
Binlog_Ignore_DB:由数据库参数binlog_ignore_db填充,如果以上任何配置中都不存在值,那么所有数据库中的写入活动都会被列入二进制日志中。
Executed_Gtid_Set:是MySQL5.6.6的新特性,显示在主库上执行全局事务标识符
在从库上执行show slave status
点击(此处)折叠或打开
- mysql> show slave status \G
- *************************** 1. row ***************************
- Slave_IO_State: Waiting for master to send event
- Master_Host: 192.168.8.57
- Master_User: repl
- Master_Port: 3306
- Connect_Retry: 60
- Master_Log_File: mysql-bin-3306.000009
- Read_Master_Log_Pos: 35946018
- Relay_Log_File: slaveone-relay-bin.000009
- Relay_Log_Pos: 35946241
- Relay_Master_Log_File: mysql-bin-3306.000009
- 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: 35946018
- Relay_Log_Space: 35946622
- 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: 20a98fbe-9ea7-11e7-b3c1-0800273e92c0
- Master_Info_File: /mysql/data/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:
- Executed_Gtid_Set:
- Auto_Position: 0
- Replicate_Rewrite_DB:
- Channel_Name:
- Master_TLS_Version:
- 1 row in set (0.05 sec)
Read_Master_Log_Pos:当前主库二进制日志已经被从库I/O线程读取到的位置
Relay_Log_File:线程中正在读取的中继日志的位置
Relay_Log_Pos:被从库线程读取并执行的当前中继日志的位置
Relay_Master_Log_File:记载了包含最近一个被从库SQL线程执行的事件的二进制文件的位置
Slave_IO_Running:用来说明从库服务器是否已经连接到主库,三个值:是,否,正在连接
Slave_SQL_Running:shuom SQL线程是否正在运行