六、启动各服务器的相关服务
MySQL-M1和MySQL-M2服务器上启动
/etc/init.d/mysql-mmm-agent start
MySQL-MON服务器上启动
/etc/init.d/mysql-mmm-monitor start
在MySQL-MON监控机上查看MMM状态信息:
[root@MySQL-MON mysql-mmm]# mmm_control show
MySQL-M1(192.168.8.32) master/ONLINE. Roles: reader(192.168.8.35), writer(192.168.8.30)
MySQL-M2(192.168.8.33) master/ONLINE. Roles: reader(192.168.8.34)
[root@MySQL-MON mysql-mmm]# mmm_control checks all
MySQL-M2 ping [last change: 2012/10/15 05:07:35] OK
MySQL-M2 mysql [last change: 2012/10/15 05:07:35] OK
MySQL-M2 rep_threads [last change: 2012/10/15 05:07:35] OK
MySQL-M2 rep_backlog [last change: 2012/10/15 05:07:35] OK: Backlog is null
MySQL-M1 ping [last change: 2012/10/15 05:07:35] OK
MySQL-M1 mysql [last change: 2012/10/15 05:07:35] OK
MySQL-M1 rep_threads [last change: 2012/10/15 05:07:35] OK
MySQL-M1 rep_backlog [last change: 2012/10/15 05:07:35] OK: Backlog is null
[root@MySQL-MON mysql-mmm]# mmm_control mode
ACTIVE
下面分别查看各服务器的日志信息:
[root@MySQL-M1 mysql-mmm]# cat /var/log/mysql-mmm/mmm_agentd.log
2012/10/15 05:06:06 INFO We have some new roles added or old rules deleted!
2012/10/15 05:06:06 INFO Added: reader(192.168.8.35), writer(192.168.8.30)
[root@MySQL-M2 mysql-mmm]# cat /var/log/mysql-mmm/mmm_agentd.log
2012/10/16 14:53:51 INFO We have some new roles added or old rules deleted!
2012/10/16 14:53:51 INFO Added: reader(192.168.8.34)
[root@MySQL-MON ~]# cat /var/log/mysql-mmm/mmm_mond.log
2012/10/15 05:07:36 FATAL Couldn't open status file '/var/lib/mysql-mmm/mmm_mond.status': Starting up without status information.
2012/10/15 05:08:38 FATAL State of host 'MySQL-M2' changed from AWAITING_RECOVERY to ONLINE because of auto_set_online(10 seconds). It was in state AWAITING_RECOVERY for 10 seconds
2012/10/15 05:08:38 FATAL State of host 'MySQL-M1' changed from AWAITING_RECOVERY to ONLINE because of auto_set_online(10 seconds). It was in state AWAITING_RECOVERY for 10 seconds
下面再看下各服务器的服务进程信息:
[root@MySQL-MON ~]# ps aux |grep mmm
root 19176 0.0 2.8 115784 14320 ? S 05:07 0:00 mmm_mond
root 19178 0.3 14.4 331756 71556 ? Sl 05:07 0:18 mmm_mond
root 19185 0.1 1.8 105824 9376 ? S 05:07 0:06 perl /usr/libexec/mysql-mmm/monitor/checker ping_ip
root 19188 0.0 2.2 137644 10940 ? S 05:07 0:05 perl /usr/libexec/mysql-mmm/monitor/checker mysql
root 19190 0.0 1.8 105824 9384 ? S 05:07 0:02 perl /usr/libexec/mysql-mmm/monitor/checker ping
root 19192 0.1 2.2 137644 10984 ? S 05:07 0:07 perl /usr/libexec/mysql-mmm/monitor/checker rep_backlog
root 19194 0.1 2.2 137644 10984 ? S 05:07 0:07 perl /usr/libexec/mysql-mmm/monitor/checker rep_threads
root 19308 0.0 0.1 61228 720 pts/1 R+ 06:42 0:00 grep mmm
[root@MySQL-M1 mysql-mmm]# ps aux |grep mmm
root 1371 0.0 0.1 61228 724 pts/1 R+ 06:40 0:00 grep mmm
root 24228 0.0 2.2 106096 11068 ? S 04:58 0:00 mmm_agentd
root 24230 0.2 2.6 140148 13204 ? S 04:58 0:16 mmm_agentd
下面再看下VIP绑定信息:
