KING01 and king02 are mainly from each other, king03 as king01 slave
KING01,KING02,KING03 installation Mmm_agent
[Email protected] ~]# CD/USR/LOCAL/SRC
[Email protected] src]# RPM-IVH epel-release-6-8.noarch.rpm
[Email protected] ~]# yum-y install mysql-mmm-agent
[Email protected] ~]# Rpm-qa | grep mysql-mmm-agent
Mysql-mmm-agent-2.2.1-2.el6.noarch
[Email protected] ~]# CD/USR/LOCAL/SRC
[Email protected] src]# RPM-IVH epel-release-6-8.noarch.rpm
[Email protected] ~]# yum-y install mysql-mmm-agent
[Email protected] ~]# Rpm-qa | grep mysql-mmm-agent
Mysql-mmm-agent-2.2.1-2.el6.noarch
[Email protected] ~]# CD/USR/LOCAL/SRC
[Email protected] src]# RPM-IVH epel-release-6-8.noarch.rpm
[Email protected] ~]# yum-y install mysql-mmm-agent
[Email protected] ~]# Rpm-qa | grep mysql-mmm-agent
Mysql-mmm-agent-2.2.1-2.el6.noarch
[Email protected] ~]# mysql-uroot-pabcd.1234
Mysql> Grant replication Client on * * to ' mmm_monitor ' @ '% ' identified by ' mmm_monitor ';
Mysql> Grant Super,replication client,process on * * to ' mmm_agent ' @ ' percent ' identified by ' mmm_agent ';
[Email protected] ~]# cd/etc/mysql-mmm/
[Email protected] mysql-mmm]# VI mmm_common.conf
Active_master_role writer
Cluster_interface eth0
Pid_path/var/run/mysql-mmm/mmm_agentd.pid
bin_path/usr/libexec/mysql-mmm/
Replication_user REPL
Replication_password REPL
Agent_user mmm_agent
Agent_password mmm_agent
IP 192.168.1.201
Mode Master
Peer DB2
IP 192.168.1.202
Mode Master
Peer DB1
IP 192.168.1.203
mode slave
<role writer>
Hosts DB1, DB2
IPs 192.168.1.200
Mode Exclusive
</role>
<role reader>
Hosts DB1, DB2, DB3
IPs 192.168.1.201,192.168.1.202,192.168.1.203
Mode Balanced
</role>
[Email protected] mysql-mmm]# SCP mmm_common.conf [email protected]:/etc/mysql-mmm/
[Email protected] mysql-mmm]# SCP mmm_common.conf [email protected]:/etc/mysql-mmm/
[Email protected] mysql-mmm]# VI mmm_agent.conf
Include mmm_common.conf
# the ' This ' variable refers to this server. Proper operation requires
# That's "This" server (db1 by default), as well as all other servers, has the
# proper IP addresses set in mmm_common.conf.
This DB1
[Email protected] ~]# cd/etc/default/
[Email protected] default]# VI mysql-mmm-agent
# mysql-mmm-agent Defaults
Enabled=1
[Email protected] ~]# CD/ETC/INIT.D
[[email protected] init.d]#./mysql-mmm-agent start
[Email protected] init.d]#./mysql-mmm-agent status
MMM_AGENTD (PID 2915) is running ...
[Email protected] ~]# cd/etc/mysql-mmm/
[Email protected] mysql-mmm]# VI mmm_agent.conf
Include mmm_common.conf
# the ' This ' variable refers to this server. Proper operation requires
# That's "This" server (db1 by default), as well as all other servers, has the
# proper IP addresses set in mmm_common.conf.
This DB2
[Email protected] ~]# cd/etc/default/
[Email protected] default]# VI mysql-mmm-agent
# mysql-mmm-agent Defaults
Enabled=1
[Email protected] ~]# CD/ETC/INIT.D
[[email protected] init.d]#./mysql-mmm-agent start
[Email protected] init.d]#./mysql-mmm-agent status
MMM_AGENTD (PID 3907) is running ...
[Email protected] ~]# cd/etc/mysql-mmm/
[Email protected] mysql-mmm]# VI mmm_agent.conf
Include mmm_common.conf
# the ' This ' variable refers to this server. Proper operation requires
# That's "This" server (db1 by default), as well as all other servers, has the
# proper IP addresses set in mmm_common.conf.
This DB3
[Email protected] ~]# cd/etc/default/
[Email protected] default]# VI mysql-mmm-agent
# mysql-mmm-agent Defaults
Enabled=1
[Email protected] ~]# CD/ETC/INIT.D
[[email protected] init.d]#./mysql-mmm-agent start
[Email protected] init.d]#./mysql-mmm-agent status
MMM_AGENTD (PID 2176) is running ...
KING04 installation Mmm_monitor
[Email protected] ~]# CD/USR/LOCAL/SRC
[Email protected] src]# RPM-IVH epel-release-6-8.noarch.rpm
[Email protected] src]# yum-y install mysql-mmm*
[Email protected] src]# Rpm-qa | grep mysql-mmm
Mysql-mmm-tools-2.2.1-2.el6.noarch
Mysql-mmm-agent-2.2.1-2.el6.noarch
Mysql-mmm-monitor-2.2.1-2.el6.noarch
Mysql-mmm-2.2.1-2.el6.noarch
[Email protected] ~]# cd/etc/mysql-mmm/
[Email protected] mysql-mmm]# SCP mmm_common.conf [email protected]:/etc/mysql-mmm/
[Email protected] mysql-mmm]# VI mmm_mon.conf
Include mmm_common.conf
<monitor>
IP 127.0.0.1
Pid_path/var/run/mysql-mmm/mmm_mond.pid
Bin_path/usr/libexec/mysql-mmm
Status_path/var/lib/mysql-mmm/mmm_mond.status
Ping_ips 192.168.1.1,192.168.1201,192.168.1.202,192.168.1.203
Auto_set_online 10
# The Kill_host_bin does not exist by default, though the monitor would
# Throw a warning about it missing. See the section 5.10 "Kill Host
# functionality "in the PDF documentation.
#
# Kill_host_bin/usr/libexec/mysql-mmm/monitor/kill_host
#
</monitor>
Monitor_user Mmm_monitor
Monitor_password Mmm_monitor
Debug 0
[Email protected] ~]# cd/etc/init.d/
[[email protected] init.d]#./mysql-mmm-monitor start
[Email protected] init.d]#./mysql-mmm-monitor status
Mmm_mond (PID 1175) is running ...
[Email protected] ~]# Mmm_control Help
Valid Commands is:
Help-show this message
Ping-ping Monitor
Show-show status
Checks [
Set_online
Set_offline
Mode-print current mode.
Set_active-switch into active mode.
Set_manual-switch into manual mode.
Set_passive-switch into passive mode.
Move_role [--force] <role>
(Only use--force if you know, what is doing!)
SET_IP <ip>
[Email protected] ~]# Mmm_control mode
ACTIVE
[Email protected] ~]# Mmm_control Show
DB1 (192.168.1.201) master/online. Roles:reader (192.168.1.201), writer (192.168.1.200)
DB2 (192.168.1.202) master/online. Roles:reader (192.168.1.202)
DB3 (192.168.1.203) slave/online. Roles:reader (192.168.1.203)
[Email protected] ~]# Mmm_control checks all
DB2 Ping [last CHANGE:2018/02/11 06:10:13] OK
DB2 MySQL [last CHANGE:2018/02/11 06:10:13] OK
DB2 rep_threads [last CHANGE:2018/02/11 06:10:13] OK
DB2 Rep_backlog [last CHANGE:2018/02/11 06:10:13] Ok:backlog is null
Db3 Ping [last CHANGE:2018/02/11 06:10:13] OK
DB3 MySQL [last CHANGE:2018/02/11 06:10:13] OK
DB3 rep_threads [last CHANGE:2018/02/11 06:10:13] OK
DB3 Rep_backlog [last CHANGE:2018/02/11 06:10:13] Ok:backlog is null
DB1 Ping [last CHANGE:2018/02/11 06:10:13] OK
DB1 MySQL [last CHANGE:2018/02/11 06:10:13] OK
DB1 rep_threads [last CHANGE:2018/02/11 06:15:39] OK
DB1 Rep_backlog [last CHANGE:2018/02/11 06:15:27] Ok:backlog is null
MYSQL MMM Deployment Transcript