master:
show master status的结果中的File和Position;比较简单,就表明了当前master的当前的logbin文件及写入的位置
slave:
show slave status结果中的:
Master_Log_File,Read_Master_Log_Pos表示了当前slave读到的master的file和pos,这部分数据是有安全保障的,DB完蛋了,只要读到DR了,就不会丢了。而Relay_Master_Log_File,Exec_Master_Log_Pos表示的是当前Slave已经执行了的master上logbin的文件及位置。
slave status还有个更直观的指标是Seconds_Behind_Master,可以看到DR落后DB的时间。
因为部分情况下(DR没有复制权限和serverid相同),可能slave前两个指标落后master很多,同时io,sqlruning状态又都是yes,现在的监控是对比slave的后两个状态跟master取过来的file和pos作对比。这能反映跟进状态,但是不一定就有那么多的logbin没过来。因为那要看slave status的前两个指标。
下边是一个slave的状态:
Slave_IO_State: Queueing master event to the relay log
Master_Host: 172.16.216.32
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: world_4.051779
Read_Master_Log_Pos: 7589551
Relay_Log_File: worldbak_4-relay-bin.107887
Relay_Log_Pos: 16940857
Relay_Master_Log_File: world_4.051770
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB: test,mysql
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: 2294
Relay_Log_Space: 259279692
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: 500
1 row in set (0.00 sec)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/82392/viewspace-196157/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/82392/viewspace-196157/