show slave status
2024-08-29 13:24:18
Slave_IO_State: Waiting for master to send event
Master_Host: 10.1.1.1
Master_User: rep_user
Master_Port: 3306
Connect_Retry: 10
Master_Log_File: binlog.000026
Read_Master_Log_Pos: 446
Relay_Log_File: relay.000008
Relay_Log_Pos: 589
Relay_Master_Log_File: binlog.000026
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: 446
Relay_Log_Space: 878
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: 2211
Master_Log_File: binlog.000026,对应读取的master二进制文件
Read_Master_Log_Pos: 446 读到了哪个位置
Relay_Master_Log_File: binlog.000026 重放的二进制文件,对应master二进制文件
Exec_Master_Log_Pos: 446 重放到了哪个位置
Relay_Log_File: relay.000008 保存的中继日志
Relay_Log_Pos: 589 读取中继日志,到了哪个位置
Slave有两个线程,I/O线程从Master接收二进制日志文件,写入本地的中继日志,SQL线程,读取中继日志,重放。典型的生产者/消费者模型。
中继日志有三个位置:I/O从Master读到了哪个位置,SQL执行中继日志,执行到了哪个位置,重放之后,会有一个位置对应Master上面的二进制文件位置。
Read_Master_Log_Pos和Exec_Master_Log_Pos相等,说明没有需要重放的内容了。
Read_Master_Log_Pos与Master 上面的show master status 位置相等,说明没有需要读取的内容,二者已经完全同步。
特别注意:Seconds_Behind_Master不是表示Slave比Master落后多少,而是对于SQL线程,中继日志中还有多少没有执行。
Seconds_Behind_Master=0 不表示Slave与Master完全同步,而是中继日志执行完了。要判断是否完全同步,还需要判断Master记录到了哪个位置和Slave读到了哪个位置。
注:在Master可以并发的查询,但是在Slave只能串行执行,因为Slave只有一个SQL线程重放中继日志,这会成为瓶颈。
最新文章
- VB.NET WinForm获取运行程序用户名
- jquery总结05-常用事件03-键盘事件
- protoc 命令参数
- 谷歌开源项目Google Preview Image Extractor(PIEX) (附上完整demo代码)
- Symantec System Recovery
- C primer plus 读书笔记第四章
- python 之 Paramiko学习
- Context Switch and System Call
- php字符串比较
- 多源最短路Floyd 算法————matlab实现
- Charles Proxy 4.1.2 破解版
- nodejs异步请求重试策略总结
- Linux命令-用户及权限管理
- python基础学习(六)函数基础
- office 2016 破解教程
- Visualforce控制器
- [Tensorflow] Practice - The Tensorflow Way
- 不同AI学科之间的联系
- python全栈开发 随笔 'is' 和 == 的比较知识与区别 编码和解码的内容及转换
- c++处理类型与自定义数据结构