===想确认sql_thread线程是否应用完了io_thread接收到的了relay log,看 Master_Log_File=Relay_Master_Log_File , Read_Master_Log_Pos=Exec_Master_Log_Pos

  1. Master_Log_File: mysql-bin.000004 #当前的slave已经读取了master的binlog文件--slave I/O thread
  2. Read_Master_Log_Pos: 46187589 #当前的slave读取的master binlog---mysql_binlog.000004 位置是46187589--slave I/O thread
  3. Relay_Log_File: relaylog.000008 #当前relay文件
  4. Relay_Log_Pos: 46187752 #当前relay文件位置的点relaylog.000008,位置是46187752
  5. Relay_Master_Log_File: mysql-bin.000004 #当前slave的sql线程应用到master的binlog的mysql-bin.000004,位置为下一行的 46187589--slave SQL thread
  6. Slave_IO_Running: Yes
  7. Slave_SQL_Running: Yes
  8. Skip_Counter: 0
  9. Exec_Master_Log_Pos: 46187589 #当前sql_thread线程执行到binlog的位置点,---slave SQL thread
  10. Relay_Log_Space: 46187918 #The total combined size of all existing relay log files. 所有存在的relay log文件的总大小
  11. Until_Condition: None

mysql 5.6 官方文档

(Master_Log_file, Read_Master_Log_Pos): Coordinates in the master binary log indicating how far the slave I/O thread has read events from that log.
(Relay_Master_Log_File, Exec_Master_Log_Pos): Coordinates in the master binary log indicating how far the slave SQL thread has executed events received from that log.
(Relay_Log_File, Relay_Log_Pos): Coordinates in the slave relay log indicating how far the slave SQL thread has executed the relay log. These correspond to the preceding coordinates, but are
expressed in slave relay log coordinates rather than master binary log coordinates.

  1. SHOW SLAVE STATUS Syntax
  2. This statement provides status information on essential parameters of the slave threads. It requires either
  3. the SUPER or REPLICATION CLIENT privilege.
  4. If you issue this statement using the mysql client, you can use a \G statement terminator rather than a
  5. semicolon to obtain a more readable vertical layout:
  6. mysql> SHOW SLAVE STATUS\G
  7. *************************** 1. row ***************************
  8. Slave_IO_State: Waiting for master to send event
  9. Master_Host: localhost
  10. Master_User: root
  11. Master_Port: 13000
  12. Connect_Retry: 60
  13. Master_Log_File: master-bin.000002
  14. Read_Master_Log_Pos: 1307
  15. Relay_Log_File: slave-relay-bin.000003
  16. Relay_Log_Pos: 1508
  17. Relay_Master_Log_File: master-bin.000002
  18. Slave_IO_Running: Yes
  19. Slave_SQL_Running: Yes
  20. Replicate_Do_DB:
  21. Replicate_Ignore_DB:
  22. Replicate_Do_Table:
  23. Replicate_Ignore_Table:
  24. Replicate_Wild_Do_Table:
  25. Replicate_Wild_Ignore_Table:
  26. Last_Errno: 0
  27. Last_Error:
  28. Skip_Counter: 0
  29. Exec_Master_Log_Pos: 1307
  30. Relay_Log_Space: 1858
  31. Until_Condition: None
  32. Until_Log_File:
  33. Until_Log_Pos: 0
  34. Master_SSL_Allowed: No
  35. Master_SSL_CA_File:
  36. Master_SSL_CA_Path:
  37. Master_SSL_Cert:
  38. Master_SSL_Cipher:
  39. Master_SSL_Key:
  40. Seconds_Behind_Master: 0
  41. Master_SSL_Verify_Server_Cert: No
  42. Last_IO_Errno: 0
  43. Last_IO_Error:
  44. Last_SQL_Errno: 0
  45. Last_SQL_Error:
  46. Replicate_Ignore_Server_Ids:
  47. Master_Server_Id: 1
  48. Master_UUID: 3e11fa47-71ca-11e1-9e33-c80aa9429562
  49. Master_Info_File: /var/mysqld.2/data/master.info
  50. SQL_Delay: 0
  51. SQL_Remaining_Delay: NULL
  52. Slave_SQL_Running_State: Reading event from the relay log
  53. Master_Retry_Count: 10
  54. Master_Bind:
  55. Last_IO_Error_Timestamp:
  56. Last_SQL_Error_Timestamp:
  57. Master_SSL_Crl:
  58. Master_SSL_Crlpath:
  59. Retrieved_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5
  60. Executed_Gtid_Set: 3e11fa47-71ca-11e1-9e33-c80aa9429562:1-5
  61. Auto_Position: 1
  1. Slave_IO_State
  2. A copy of the State field of the SHOW PROCESSLIST output for the slave I/O thread. This tells you whatthe thread is doing: trying to connect to the master, waiting for events from the master, reconnecting to
  3. the master, and so on. For a listing of possible states, see Section 8.14.6, Replication Slave I/O ThreadStates”.
  4. Master_Host
  5. The master host that the slave is connected to.
  6. Master_User
  7. The user name of the account used to connect to the master.
  8. Master_Port
  9. The port used to connect to the master.
  10. Connect_Retry
  11. The number of seconds between connect retries (default 60). This can be set with the CHANGE MASTER
  12. TO statement.
  13. Master_Log_File
  14. The name of the master binary log file from which the I/O thread is currently reading.
  15. Read_Master_Log_Pos
  16. The position in the current master binary log file up to which the I/O thread has read.
  17. Relay_Log_File
  18. The name of the relay log file from which the SQL thread is currently reading and executing.
  19. Relay_Log_Pos
  20. The position in the current relay log file up to which the SQL thread has read and executed.
  21. Relay_Master_Log_File
  22. The name of the master binary log file containing the most recent event executed by the SQL thread.
  23. Slave_IO_Running
  24. Whether the I/O thread is started and has connected successfully to the master. Internally, the state of
  25. this thread is represented by one of the following three values:
  26. MYSQL_SLAVE_NOT_RUN. The slave I/O thread is not running. For this state,
  27. Slave_IO_Running is No.
  28. MYSQL_SLAVE_RUN_NOT_CONNECT. The slave I/O thread is running, but is not connected to a
  29. replication master. For this state, Slave_IO_Running is Connecting.
  30. MYSQL_SLAVE_RUN_CONNECT. The slave I/O thread is running, and is connected to a
  31. replication master. For this state, Slave_IO_Running is Yes.
  32. The value of the Slave_running system status variable corresponds with this value.
  33. Slave_SQL_Running
  34. Whether the SQL thread is started.
  35. Replicate_Do_DB, Replicate_Ignore_DB
  36. The lists of databases that were specified with the --replicate-do-db and --replicate-ignoredb options, if any.
  37. Replicate_Do_Table, Replicate_Ignore_Table, Replicate_Wild_Do_Table,
  38. Replicate_Wild_Ignore_Table
  39. The lists of tables that were specified with the --replicate-do-table, --replicate-ignoretable, --replicate-wild-do-table, and --replicate-wild-ignore-table options, if any.
  40. Last_Errno, Last_Error
  41. These columns are aliases for Last_SQL_Errno and Last_SQL_Error.
  42. Issuing RESET MASTER or RESET SLAVE resets the values shown in these columns.
  43. Note
  44. When the slave SQL thread receives an error, it reports the error first, then stops the SQL thread. This means that there is a small window of time during which
  45. SHOW SLAVE STATUS shows a nonzero value for Last_SQL_Errno even though Slave_SQL_Running still displays Yes.
  46. Skip_Counter
  47. The current value of the sql_slave_skip_counter system variable. See Section 13.4.2.4, SET
  48. GLOBAL sql_slave_skip_counter Syntax”.
  49. Exec_Master_Log_Pos
  50. The position in the current master binary log file to which the SQL thread has read and executed,
  51. marking the start of the next transaction or event to be processed. You can use this value with
  52. the CHANGE MASTER TO statement's MASTER_LOG_POS option when starting a new slave from an existing slave, so that the new slave reads from this point. The coordinates given by
  53. (Relay_Master_Log_File, Exec_Master_Log_Pos) in the master's binary log correspond to the coordinates given by (Relay_Log_File, Relay_Log_Pos) in the relay log.
  54. When using a multithreaded slave (by setting slave_parallel_workers to a nonzero value), the value in this column actually represents a low-water mark, before which no uncommitted transactions
  55. remain. Because the current implementation allows execution of transactions on different databases in a different order on the slave than on the master, this is not necessarily the position of the most recently
  56. executed transaction.
  57. Relay_Log_Space
  58. The total combined size of all existing relay log files.
  59. Until_Condition, Until_Log_File, Until_Log_Pos
  60. The values specified in the UNTIL clause of the START SLAVE statement. Until_Condition has these values:
  61. None if no UNTIL clause was specified
  62. Master if the slave is reading until a given position in the master's binary log
  63. • Relay if the slave is reading until a given position in its relay log
  64. • SQL_BEFORE_GTIDS if the slave SQL thread is processing transactions until it has reached the first
  65. transaction whose GTID is listed in the gtid_set.
  66. • SQL_AFTER_GTIDS if the slave threads are processing all transactions until the last transaction in the
  67. gtid_set has been processed by both threads.
  68. • SQL_AFTER_MTS_GAPS if a multithreaded slave's SQL threads are running until no more gaps are
  69. found in the relay log.
  70. Until_Log_File and Until_Log_Pos indicate the log file name and position that define the
  71. coordinates at which the SQL thread stops executing.
  72. For more information on UNTIL clauses, see Section 13.4.2.5, START SLAVE Syntax”.
  73. Master_SSL_Allowed, Master_SSL_CA_File, Master_SSL_CA_Path, Master_SSL_Cert,
  74. Master_SSL_Cipher, Master_SSL_CRL_File, Master_SSL_CRL_Path, Master_SSL_Key,
  75. Master_SSL_Verify_Server_Cert
  76. These fields show the SSL parameters used by the slave to connect to the master, if any.
  77. Master_SSL_Allowed has these values:
  78. Yes if an SSL connection to the master is permitted
  79. No if an SSL connection to the master is not permitted
  80. Ignored if an SSL connection is permitted but the slave server does not have SSL support enabled
  81. The values of the other SSL-related fields correspond to the values of the MASTER_SSL_CA,
  82. MASTER_SSL_CAPATH, MASTER_SSL_CERT, MASTER_SSL_CIPHER, MASTER_SSL_CRL,
  83. MASTER_SSL_CRLPATH, MASTER_SSL_KEY, and MASTER_SSL_VERIFY_SERVER_CERT options to the
  84. CHANGE MASTER TO statement. See Section 13.4.2.1, CHANGE MASTER TO Syntax”.
  85. Seconds_Behind_Master
  86. This field is an indication of how late the slave is:
  87. When the slave is actively processing updates, this field shows the difference between the current timestamp on the slave and the original timestamp logged on the master for the event currently being processed on the slave.
  88. When no event is currently being processed on the slave, this value is 0. In essence, this field measures the time difference in seconds between the slave SQL thread and the slave I/O thread. If the network connection between master and slave is fast, the slave I/O thread is very
  89. close to the master, so this field is a good approximation of how late the slave SQL thread is compared
  90. to the master. If the network is slow, this is not a good approximation; the slave SQL thread may quite often be caught up with the slow-reading slave I/O thread, so Seconds_Behind_Master often shows
  91. a value of 0, even if the I/O thread is late compared to the master. In other words, this column is useful only for fast networks.
  92. This time difference computation works even if the master and slave do not have identical clock times, provided that the difference, computed when the slave I/O thread starts, remains constant from then
  93. on. Any changesincluding NTP updatescan lead to clock skews that can make calculation of Seconds_Behind_Master less reliable.
  94. In MySQL 5.6.9 and later, this field is NULL (undefined or unknown) if the slave SQL thread is not
  95. running, or if the SQL thread has consumed all of the relay log and the slave I/O thread is not running.
  96. Previously, this field was NULL if the slave SQL thread or the slave I/O thread was not running or was
  97. not connected to the master. (Bug #12946333) For example, if (prior to MySQL 5.6.9) the slave I/O
  98. thread was running but was not connected to the master and was sleeping for the number of seconds
  99. given by the CHANGE MASTER TO statement or --master-connect-retry option (default 60) before
  100. reconnecting, the value was NULL. Now in such cases, the connection to the master is not tested;
  101. instead, if the I/O thread is running but the relay log is exhausted, Seconds_Behind_Master is set to
  102. 0.
  103. The value of Seconds_Behind_Master is based on the timestamps stored in events, which are
  104. preserved through replication. This means that if a master M1 is itself a slave of M0, any event from M1's
  105. binary log that originates from M0's binary log has M0's timestamp for that event. This enables MySQL
  106. to replicate TIMESTAMP successfully. However, the problem for Seconds_Behind_Master is that if
  107. M1 also receives direct updates from clients, the Seconds_Behind_Master value randomly fluctuates
  108. because sometimes the last event from M1 originates from M0 and sometimes is the result of a direct
  109. update on M1.
  110. When using a multithreaded slave, you should keep in mind that this value is based on
  111. Exec_Master_Log_Pos, and so may not reflect the position of the most recently committed
  112. transaction.
  113. • Last_IO_Errno, Last_IO_Error
  114. The error number and error message of the most recent error that caused the I/O thread to stop. An
  115. error number of 0 and message of the empty string mean “no error.” If the Last_IO_Error value is not
  116. empty, the error values also appear in the slave's error log.
  117. I/O error information includes a timestamp showing when the most recent I/O thread error occurred. This
  118. timestamp uses the format YYMMDD HH:MM:SS, and appears in the Last_IO_Error_Timestamp
  119. column.
  120. Issuing RESET MASTER or RESET SLAVE resets the values shown in these columns.
  121. Last_SQL_Errno, Last_SQL_Error
  122. The error number and error message of the most recent error that caused the SQL thread to stop. An
  123. error number of 0 and message of the empty string mean no error.” If the Last_SQL_Error value is
  124. not empty, the error values also appear in the slave s error log.
  125. SQL error information includes a timestamp showing when the most recent SQL thread
  126. error occurred. This timestamp uses the format YYMMDD HH:MM:SS, and appears in the
  127. Last_SQL_Error_Timestamp column.
  128. Issuing RESET MASTER or RESET SLAVE resets the values shown in these columns.
  129. Replicate_Ignore_Server_Ids
  130. In MySQL 5.6, you set a slave to ignore events from 0 or more masters using the IGNORE_SERVER_IDS
  131. option of the CHANGE MASTER TO statement. By default this is blank, and is usually modified
  132. only when using a circular or other multi-master replication setup. The message shown for
  133. Replicate_Ignore_Server_Ids when not blank consists of a comma-delimited list of one or more
  134. numbers, indicating the server IDs to be ignored. For example:
  135. Replicate_Ignore_Server_Ids: 2, 6, 9
  136. Note
  137. Ignored_server_ids also shows the server IDs to be ignored, but is a
  138. space-delimited list, which is preceded by the total number of server IDs to
  139. be ignored. For example, if a CHANGE MASTER TO statement containing the
  140. IGNORE_SERVER_IDS = (2,6,9) option has been issued to tell a slave to
  141. ignore masters having the server ID 2, 6, or 9, that information appears as:
  142. Ignored_server_ids: 3 2 6 9
  143. where 3 is the total number of server IDs being ignored
  144. Replicate_Ignore_Server_Ids filtering is performed by the I/O thread, rather than by the SQL
  145. thread, which means that events which are filtered out are not written to the relay log. This differs from
  146. the filtering actions taken by server options such --replicate-do-table, which apply to the SQL
  147. thread.
  148. Master_Server_Id
  149. The server_id value from the master.
  150. Master_UUID
  151. The server_uuid value from the master.
  152. Master_Info_File
  153. The location of the master.info file.
  154. SQL_Delay
  155. The number of seconds that the slave must lag the master.
  156. SQL_Remaining_Delay
  157. When Slave_SQL_Running_State is Waiting until MASTER_DELAY seconds after master
  158. executed event, this field contains the number of delay seconds remaining. At other times, this field is
  159. NULL.
  160. Slave_SQL_Running_State
  161. The state of the SQL thread (analogous to Slave_IO_State). The value is identical to the State value
  162. of the SQL thread as displayed by SHOW PROCESSLIST; Section 8.14.7, Replication Slave SQL Thread
  163. States”, provides a listing of possible states.
  164. Master_Retry_Count
  165. The number of times the slave can attempt to reconnect to the master in the event of a lost connection.
  166. This value can be set using the MASTER_RETRY_COUNT option of the CHANGE MASTER TO statement
  167. (preferred) or the older --master-retry-count server option (still supported for backward
  168. compatibility).
  169. Master_Bind
  170. The network interface that the slave is bound to, if any. This is set using the MASTER_BIND option for the
  171. CHANGE MASTER TO statement.
  172. Last_IO_Error_Timestamp
  173. A timestamp in YYMMDD HH:MM:SS format that shows when the most recent I/O error took place.
  174. Last_SQL_Error_Timestamp
  175. A timestamp in YYMMDD HH:MM:SS format that shows when the most recent SQL error occurred.
  176. Retrieved_Gtid_Set
  177. The set of global transaction IDs corresponding to all transactions received by this slave. Empty if GTIDs
  178. are not in use.
  179. This is the set of all GTIDs that exist or have existed in the relay logs. Each GTID is added as soon as
  180. the Gtid_log_event is received. This can cause partially transmitted transactions to have their GTIDs
  181. included in the set.
  182. When all relay logs are lost due to executing RESET SLAVE or CHANGE MASTER TO, or due to the
  183. effects of the --relay-log-recovery option, the set is cleared. When relay_log_purge = 1, the
  184. newest relay log is always kept, and the set is not cleared.
  185. Executed_Gtid_Set
  186. The set of global transaction IDs written in the binary log. This is the same as the value for the global
  187. gtid_executed system variable on this server, as well as the value for Executed_Gtid_Set in the
  188. output of SHOW MASTER STATUS on this server. Empty if GTIDs are not in use. See GTID Sets for more
  189. information.
  190. Auto_Position
  191. 1 if autopositioning is in use; otherwise 0.

mysql ,show slave status详解的更多相关文章

  1. SHOW SLAVE STATUS 详解

    MySQL同步功能由3个线程(master上1个,slave上2个)来实现.执行 DE>START SLAVEDE> 语句后,slave就创建一个I/O线程.I/O线程连接到master上 ...

  2. MySQL运行状态show status详解

    状态名 作用域 详细解释 Aborted_clients Global 由于客户端没有正确关闭连接导致客户端终止而中断的连接数 Aborted_connects Global 试图连接到MySQL服务 ...

  3. [转载]MySQL运行状态show status详解

    要查看MySQL运行状态,要优化MySQL运行效率都少不了要运行show status查看各种状态,下面是参考官方文档及网上资料整理出来的中文详细解释,不管你是初学mysql还是你是mysql专业级的 ...

  4. mysql的show status详解(转载)

    SHOW STATUS提供服务器的状态信息(象mysqladmin extended-status一样).输出类似于下面的显示,尽管格式和数字可以有点不同: +-------------------- ...

  5. mysql学习3:mysql之my.cnf详解

    mysql之my.cnf详解 本文转自:https://www.cnblogs.com/panwenbin-logs/p/8360703.html 以下是 my.cnf 配置文件参数解释: #*** ...

  6. MySQL权限授权认证详解

    MySQL权限授权认证详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.MySQL权限系统介绍1>.权限系统的作用是授予来自某个主机的某个用户可以查询.插入.修改.删除 ...

  7. mysql数据恢复,binlog详解

    个人博客:mysql数据恢复,binlog详解 binlog日志恢复数据,是挽救错误操作和数据损坏一根救命稻草,所以认识和使用binglog对于技术人员还是很有必要的 binlog一般用于 主从复制 ...

  8. mysql配置文件my.cnf详解

    原文地址:mysql配置文件my.cnf详解 作者:gron basedir = path 使用给定目录作为根目录(安装目录). character-sets-dir = path 给出存放着字符集的 ...

  9. MySQL复制相关参数详解

    MySQL复制相关参数详解 作者:尹正杰  版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.复制相关系统变量 1>.server_id 是必须设置在master和每个slave上的唯一标 ...

随机推荐

  1. linux配置静态ip,关闭防火墙

    在vmware下安装centos6.5通过桥接方式访问外网,因此需要配置ip. 一.ip配置 1.1. 配置动态ip vi /etc/sysconfig/network-scripts/ifcfg-e ...

  2. spring mvc: 页面重定向调整

    我的项目名称是hello, 在src/main/java目录下面建了一个chapter2目录 有三个配置文件: web.xml, chapter2-servlet.xml, applicationCo ...

  3. WPF中的事件列表 .

    以下是WPF中的常见事件汇总表(按字母排序),翻译不见得准确,但希望对你有用. 事件 描述 Annotation.AnchorChanged 新增.移除或修改 Anchor 元素时发生. Annota ...

  4. HYSBZ - 2301 莫比乌斯反演

    链接 题解:直接用公式算,用容斥来减掉重复计算的部分 但是我犯了一个非常sb的错误,直接把abcd除k了,这样算a-1的时候就错了,然后举的例子刚好还没问题= = ,结果wa了好几发 //#pragm ...

  5. VMware 虚拟镜像转 Hyper-V(Win10/2016)

    VMware 虚拟镜像转 Hyper-V(Win10/2016) 参考:http://www.askme4tech.com/how-convert-vmware-virtual-machine-hyp ...

  6. UVA 11538 排列组合

    https://vjudge.net/problem/UVA-11538#author=0 将两个不同的皇后放入N*M棋盘中,问使得二者可以相互攻击的方案个数.有可能在同一行,同一列,同一对角线,分开 ...

  7. React 源码剖析系列 - 生命周期的管理艺术

    目前,前端领域中 React 势头正盛,很少能够深入剖析内部实现机制和原理. 本系列文章 希望通过剖析 React 源码,理解其内部的实现原理,知其然更要知其所以然. 对于 React,其组件生命周期 ...

  8. 《锋利的jQuery》读书笔记(DOM+事件)

    前阵子买了一批书,就从锋利的jQuery看起吧,书中一些太过常规以及没有强记必要性的操作就不记录了. 1.DOM加载后执行JS $(document).ready(function(){ //.... ...

  9. Lua学习---编译生成lua和luac

    众所周知,Lua是一种强大的脚本语言,并且这种语言是用C语言实现的.为什么要学习这门语言?因为它可以增强我看C语言代码的功底. 我下的Lua版本是Lua5.3,关于Lua5.3的简介如下: http: ...

  10. ES中保护对象的措施总结

    必要性:  JS中的对象可随意修改属性值,可随意添加删除属性,太乱,数据安全得不到保障. 如何保护: 保护属性: 保护对属性值的修改 对象属性分为: 命名属性: 可直接用.访问到的属性 数据属性: 直 ...