后端服务器监控
1、 概述
监控模块负责对后端进行一系列检查。
它目前支持 4 种类型的检查:
connect : 连 接 所 有 后 端 , 成 功 / 失 败 记 录 在 表 中
mysql_server_connect_log;
ping : 它 对 所 有 后 端 执 行 ping 操 作 , 成 功 / 失 败 记 录 在 table 中
mysql_server_ping_log。在 mysql-monitor_ping_max_failures 丢失心跳的
情况下,它会向 MySQL_Hostgroups_Manager 发送信号以终止所有连接;
复制滞后:它检查 Seconds_Behind_Master 所有配置 max_replication_lag 大
于 0 的后端,并将检查记录在表中 mysql_server_replication_lag_log。如果
Seconds_Behind_Master>max_replication_lag 则 回 避 服 务 器 , 直 到
Seconds_Behind_Master<%max_replication_lag;
只 读 : 它 检 查 read_only 表 中 主 机 组 中 的 所 有 主 机
mysql_replication_hostgroups , 并 将 检 查 记 录 在 表 中
mysql_server_read_only_log 。 如 果 read_only=1 主 机 被 复 制 / 移 动 到
reader_hostgroup , 而 如 果 read_only=0 主 机 被 复 制 / 移 动 到
writer_hostgroup.
2、变量
一般变量:
mysql-monitor_username
指定 Monitor 模块将用于连接到后端的用户名。用户只需要 USAGE 连接、ping 和检查
的权限 read_only。REPLICATION CLIENT 如果需要监控复制滞后,用户还需要特权。
mysql-monitor_password
用户 mysql-monitor_username
的
密码
mysql-monitor_enabled
它启用或禁用 MySQL Monitor。由于 MySQL Monitor 可以干扰直接应用在 Admin 界
面上的更改,因此此变量允许临时禁用它。
连接变量:
mysql-monitor_connect_interval
执行连接检查的频率,以毫秒为单位。
mysql-monitor_connect_timeout