mysql同步__slave状态标识

     在MySQL的主从配置中,在slave上执行show slave status可以看到slave的状态,今天突然发现了输出中含有Relay_Master_Log_File和Exec_Master_Log_Pos这两项,印象中以前没有过( 也许是没注意到:( ).觉得甚是奇怪,一顿搜查,总算明白了其中含义。
     看看MySQL的Manual中是怎么解释的:
     Exec_Master_Log_Pos: The position of the last event executed by the SQL thread from the master's binary log (Relay_Master_Log_File). (Relay_Master_Log_File, Exec_Master_Log_Pos) in the master's binary log corresponds to (Relay_Log_File, Relay_Log_Pos) in the relay log.
     从字面意思看, (Relay_Master_Log_File, Exec_Master_Log_Pos)和(Relay_Log_File, Relay_Log_Pos)是对应的,它们表示的是Slave中的SQL进程中正在执行的语句的位置,表明的是Slave和Master之间的同步状态。当Slave中Relay_Master_Log_File和Master_Log_File相同且Read_Master_Log_Pos和Exec_Master_Log_Pos完全相同时,表明Slave和Master处于完全同步的状态。
    
      既然有了(Relay_Master_Log_File, Exec_Master_Log_Pos)能够表明同步状态,还要(Relay_Log_File, Relay_Log_Pos)做什么呢? 我感觉(Relay_Log_File, Relay_Log_Pos) 是给程序看的,记录Relay log中的执行点, 而(Relay_Master_Log_File, Exec_Master_Log_Pos)可以给人看,能够清楚的表明Master和Slave之间的同步状态。


  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值