show master/slave status

主库运行show master status可以看到当前二进制日志的信息,如:

点击(此处)折叠或打开

  1. mysql> show master status \G
  2. *************************** 1. row ***************************
  3.              File: mysql-bin-3306.000009
  4.          Position: 35946018
  5.      Binlog_Do_DB:
  6.  Binlog_Ignore_DB:
  7. Executed_Gtid_Set:
Binlog_Do_DB:由数据库参数binlog_do_db列出的数据库填充。
Binlog_Ignore_DB:由数据库参数binlog_ignore_db填充,如果以上任何配置中都不存在值,那么所有数据库中的写入活动都会被列入二进制日志中。
Executed_Gtid_Set:是MySQL5.6.6的新特性,显示在主库上执行全局事务标识符
在从库上执行show slave status

点击(此处)折叠或打开

  1. mysql> show slave status \G
  2. *************************** 1. row ***************************
  3.                Slave_IO_State: Waiting for master to send event
  4.                   Master_Host: 192.168.8.57
  5.                   Master_User: repl
  6.                   Master_Port: 3306
  7.                 Connect_Retry: 60
  8.               Master_Log_File: mysql-bin-3306.000009
  9.           Read_Master_Log_Pos: 35946018
  10.                Relay_Log_File: slaveone-relay-bin.000009
  11.                 Relay_Log_Pos: 35946241
  12.         Relay_Master_Log_File: mysql-bin-3306.000009
  13.              Slave_IO_Running: Yes
  14.             Slave_SQL_Running: Yes
  15.               Replicate_Do_DB:
  16.           Replicate_Ignore_DB:
  17.            Replicate_Do_Table:
  18.        Replicate_Ignore_Table:
  19.       Replicate_Wild_Do_Table:
  20.   Replicate_Wild_Ignore_Table:
  21.                    Last_Errno: 0
  22.                    Last_Error:
  23.                  Skip_Counter: 0
  24.           Exec_Master_Log_Pos: 35946018
  25.               Relay_Log_Space: 35946622
  26.               Until_Condition: None
  27.                Until_Log_File:
  28.                 Until_Log_Pos: 0
  29.            Master_SSL_Allowed: No
  30.            Master_SSL_CA_File:
  31.            Master_SSL_CA_Path:
  32.               Master_SSL_Cert:
  33.             Master_SSL_Cipher:
  34.                Master_SSL_Key:
  35.         Seconds_Behind_Master: 0
  36. Master_SSL_Verify_Server_Cert: No
  37.                 Last_IO_Errno: 0
  38.                 Last_IO_Error:
  39.                Last_SQL_Errno: 0
  40.                Last_SQL_Error:
  41.   Replicate_Ignore_Server_Ids:
  42.              Master_Server_Id: 1
  43.                   Master_UUID: 20a98fbe-9ea7-11e7-b3c1-0800273e92c0
  44.              Master_Info_File: /mysql/data/master.info
  45.                     SQL_Delay: 0
  46.           SQL_Remaining_Delay: NULL
  47.       Slave_SQL_Running_State: Slave has read all relay log; waiting for more updates
  48.            Master_Retry_Count: 86400
  49.                   Master_Bind:
  50.       Last_IO_Error_Timestamp:
  51.      Last_SQL_Error_Timestamp:
  52.                Master_SSL_Crl:
  53.            Master_SSL_Crlpath:
  54.            Retrieved_Gtid_Set:
  55.             Executed_Gtid_Set:
  56.                 Auto_Position: 0
  57.          Replicate_Rewrite_DB:
  58.                  Channel_Name:
  59.            Master_TLS_Version:
  60. 1 row in set (0.05 sec)
Master_Log_File:从库I/O线程正在读取的当前二进制日志的名称
Read_Master_Log_Pos:当前主库二进制日志已经被从库I/O线程读取到的位置
Relay_Log_File:线程中正在读取的中继日志的位置
Relay_Log_Pos:被从库线程读取并执行的当前中继日志的位置
Relay_Master_Log_File:记载了包含最近一个被从库SQL线程执行的事件的二进制文件的位置
Slave_IO_Running:用来说明从库服务器是否已经连接到主库,三个值:是,否,正在连接
Slave_SQL_Running:shuom SQL线程是否正在运行
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值