mysql主从同步(4)-Slave延迟状态监控
16lz
2021-01-22
之前部署了mysql主从同步环境(Mysql主从同步(1)-主从/主主环境部署梳理),针对主从同步过程中slave延迟状态的监控梳理如下:
在mysql日常维护工作中,对于主从复制的监控主要体现在:
1)检查数据是否一致;主从数据不同步时,参考下面两篇文档记录进行数据修复:
mysql主从同步(3)-percona-toolkit工具(数据一致性监测、延迟监控)使用梳理
利用mk-table-checksum监测Mysql主从数据一致性操作记录
2)监控主从同步延迟,同步延迟的检查工作主要从下面两方面着手:
1.一般的做法就是根据Seconds_Behind_Master的值来判断slave的延迟状态。
可以通过监控show slave status\G命令输出的Seconds_Behind_Master参数的值来判断,是否有发生主从延时。
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.101
Master_User: slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000004
Read_Master_Log_Pos: 761249
Relay_Log_File: mysql-relay-bin.000008
Relay_Log_Pos: 761408
Relay_Master_Log_File: mysql-bin.000004
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: huanqiu,huanpc
Replicate_Ignore_DB: 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: 761249
Relay_Log_Space: 761620
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: 101
Master_UUID: b667a58f-d6e0-11e6-8c0a-fa163e2d66ac
Master_Info_File: /data/mysql/data/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
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:
Auto_Position: 0
1 row in set (0.00 sec)
ERROR:
No query specified
更多相关文章
- MySQL可视化软件Work Bench导出导入数据库
- MySQL数据导入到infobright中
- Android如何通过JDBC直连访问MySQL数据库?
- flash如何自动连接mysql数据库
- lucene 4.10 检索mysql数据库
- 自建MySQL5.6数据库查询优化
- 如何使用PDO从MySQL获取正确的数据类型?
- mysql 基于position 恢复数据库
- mysql主从复制配置操作以及主主配置宕机切换演练