码迷,mamicode.com
首页 > 数据库 > 详细

show slave status 详解 【MySQL5.7】

时间:2017-10-20 00:45:56      阅读:293      评论:0      收藏:0      [点我收藏+]

标签:show slave status 详解 【mysql5.7】

以MySQL5.7.19为例,部分重要的地方用红色标注了。


>show slave status\G

*************************** 1. row ***************************

               Slave_IO_State: Waiting for master to send event

                  Master_Host: 172.16.10.12

                  Master_User: rpl

                  Master_Port: 3306

                Connect_Retry: 60

              Master_Log_File: mysql-bin.000032      正在读取的主库的binlog文件名【反映从库IO_thread执行进度】

          Read_Master_Log_Pos: 1717                  正在读取到的主库的pos【反映从库IO_thread执行进度】

               Relay_Log_File: node1-relay-bin.000012

                Relay_Log_Pos: 320

        Relay_Master_Log_File: mysql-bin.000032    正在执行到的主库上的binlog文件名【反映从库SQL_thread执行进度】

             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: 1717      当前执行到的主库的pos【反映从库SQL_thread执行进度】

              Relay_Log_Space: 6907

              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: 3306

                  Master_UUID: e00b1731-a383-11e7-ada1-000c29c99d23

             Master_Info_File: mysql.slave_master_info   表示slave复制的进度是写表存储的,而不是写文件存储

                    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: 770c8eb0-9f38-11e7-9b59-000c29c99d23:1-97,

e00b1731-a383-11e7-ada1-000c29c99d23:1-648

                Auto_Position: 0

         Replicate_Rewrite_DB:                    5.7支持动态的设置复制映射

                 Channel_Name:                    5.7支持通过不同的channel_name来实现多源复制

           Master_TLS_Version:



关于Seconds_Behind_Master的解释:

其值是通过将服务器当前的时间戳与二进制日志中的事件的时间戳相对比得到的【MySQL手册上说的是从库SQL线程与IO线程所处理的最近的日志事件的时间戳差】。

只有在执行事件时才能报告延迟。

如果备库复制线程没有启动,就会报延迟为NULL。



补充,RESET命令的用法:

1 RESET MASTER:

删除全部的binlog文件,重置mysql.index文件为空,然后重新生成一个binlog文件。


2 RESET QUERY CACHE:

删除查询缓存。


3 RESET SLAVE:

使从节点忘记它当前复制的位置,它会删除当前的relay log文件,对新的relay-log文件从0开始重新编号,但是不会改变 change master to的配置参数(这些参数是在内存中的)。


4 RESET SLAVE ALL: 

是在reset slave的基础上,进一步重置了chagne master to的参数。这样的话,show slave status\G就没有显示。


show slave status 详解 【MySQL5.7】

标签:show slave status 详解 【mysql5.7】

原文地址:http://lee90.blog.51cto.com/10414478/1974442

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!