- problem
This case requires familiarity implement MySQL-MMM deployment architecture, including the following tasks:
- Installation dependencies
- Installation package
- Configure MySQL-MMM
- Program
RHEL 6 using five virtual machines shown in Figure -2. Which 192.168.4.10,192.168.4.11 double as the MySQL master server, 192.168.4.12,192.168.4.13 as the primary server from the server, 192.168.4.100 as MySQL-MMM management and monitoring server architecture to achieve master status from monitoring MySQL server and decide to remove the failed node or return to work, architecture uses a client set up after the completion of 192.168.4.120 to access the client need to install MySQL-client packages.
FIG -2
- step
This case needs to be achieved in the following steps.
Step a: install M ySQL-MMM
1) Installation Dependencies (MySQL Cluster within five servers master1, master2, slave1, slave2, monitor) are required to install
[root@master1 ~]# yum -y install gcc* perl-Date-Manip perl-Date-Manip perl-Date-Manip perl-XML-DOM-XPath perl-XML-Parser perl-XML-RegExp rrdtool perl-Class-Singleton perl perl-DBD-MySQL perl-Params-Validate perl-MailTools perl-Time-HiRes
.. ..
2) install MySQL-MMM-dependent software package (MySQL Cluster within five servers master1, master2, slave1, slave2, monitor) need to be installed, the package provides lecturers
Installation based Log-Log4perl
[root@mysql-master1 ~]# rpm -ivh perl-Log-Log4perl-1.26-1.el6.rf.noarch.rpm
warning: perl-Log-Log4perl-1.26-1.el6.rf.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
Preparing... ######################### [100%]
1:perl-Log-Log4perl ######################## [100%]
Installation based Algorithm-Diff
[root @ mysql-master1 ~] # tar -zxvf Algorithm-Diff-1.1902.tar.gz // extract the installation package
.. ..
[Master1 the root-MySQL @ ~] Algorithm-Diff-CD # 1.1902 // to the installation directory
[root @ MySQL-Master1 Mathimatics-Numerical algorithms-Diff-1.1902] # perl Makefile.PL // generate the makefile
Checking if your kit is complete...
Looks good
Writing Makefile for Algorithm::Diff
[root @ MySQL-Master1 Mathimatics-Numerical algorithms-Diff-1.1902] the make install # the make && // compile, compile and install
.. ..
[root @ MySQL-Master1 Mathimatics-Numerical algorithms-Diff-1.1902] # cd // switch to the package directory
[root@mysql-master1 ~]#
Installation based Proc-Daemon
[Master1 the root-MySQL @ ~] # -zxvf Proc the tar-Daemon-0.03.tar.gz // extract the installation package
.. ..
[Master1 the root-MySQL @ ~] Proc-Daemon-CD # 0.03 // to the installation directory
[root @ Master1 Proc-MySQL-Daemon-0.03] # perl Makefile.PL // generate the makefile
Checking if your kit is complete...
Looks good
Writing Makefile for Proc::Daemon
[root @ Master1 Proc-MySQL-Daemon-0.03] # the make the make install && // compile, compile and install
.. ..
[root @ Master1 Proc-MySQL-Daemon-0.03] # cd // switch to the package directory
[root@mysql-master1 ~]#
Install Net-ARP virtual IP assignment tool:
[Master1 the root-MySQL @ ~] # Net-gunzip the ARP-1.0.8.tgz // use gunzip it tgz format installation package
[Master1 the root-MySQL @ ~] # Net-tar xvf the ARP-1.0.8.tar // tar extract the installation package
.. ..
[Master1 the root-MySQL @ ~] # Net-CD the ARP-1.0.8 // to the installation directory
[root @ Net-MySQL-Master1 ARP-1.0.8] # perl Makefile.PL // generate the makefile
Module Net::Pcap is required for make test!
Checking if your kit is complete...
Looks good
Writing Makefile for Net::ARP
[root @ Net-MySQL-Master1 ARP-1.0.8] # the make the make install && // compile, compile and install
.. ..
[root @ Net-MySQL-Master1 ARP-1.0.8] # cd // switch to the package directory
[root@mysql-master1 ~]#
Mysql-MMM installation package:
[Master1 the root-MySQL @ ~] # MySQL xvf the tar-MMM-2.2.1.tar.gz // extract the installation package
.. ..
[Master1 the root-MySQL @ ~] # CD-MMM-MySQL 2.2.1 // to the installation directory
[root @ Master1 MySQL-MySQL-MMM-2.2.1] # the make the make install && // compile, compile and install
.. ..
[root@mysql-master1 mysql-mmm-2.2.1]#
Step two: modify the configuration file
1) modifying the public profile
In this case five servers MySQL Cluster (master1, master2, slave1, slave2, monitor) will need to be configured, you can use scp to copy with the good one.
[root@master1 ~]# vim /etc/mysql-mmm/mmm_common.conf
active_master_role writer
<host default>
cluster_interface eth0 // master-slave synchronization is provided a user
pid_path /var/run/mmm_agentd.pid
bin_path /usr/lib/mysql-mmm/
slaveuser replication_user // set the user's master-slave synchronization
pwd123 replication_password // master-slave synchronization setting user password
agent_user Agent // MMM-User Database Control Agent
agent_password Agent // MMM-Control Agent database user password
</host>
<Host Master1> // set the first master
ip 192.168.4.10 // IP address Master1
mode the master
Use the peer Master2 // a designated primary server further
</host>
<Host Master2> // Specify another master server
ip 192.168.4.11
mode the master
peer master1
</host>
<Host Slave1> // provided from the first server
ip 192.168.4.12 // IP address slave1
MODE slave // this paragraph is configured slave server
</host>
<host slave2>
ip 192.168.4.13
mode slave
</host>
<Role Writer> // set the write server operating mode
hosts Master1, Master2 // provide written master server
IPS 192.168.4.200 // set the VIP address
the MODE exclusive // exclusive mode
</role>
<Role Reader> // set the read mode of operation server
hosts slave1, slave2 // server provides information to read
IPS 192.168.4.201,192.168.4.202 multiple virtual IP //
the MODE Balanced // balanced mode
</role>
[root@master1 ~]#
2) modify the configuration file management host (monitor host configuration)
[root@monitor ~]# vim /etc/mysql-mmm/mmm_mon.conf
include mmm_common.conf
<monitor>
ip 192.168.4.100 // set the IP address of the management host
pidpath varrunmmmmondpid
bin_path /usr/lib/mysql-mmm/
status_path /var/lib/misc/mmm_mond.status
ping_ips 192.168.4.10,192.168.4.11,192.168.4.12,192.168.4.13
// set the monitored database
</monitor>
<host default>
of monitor_user Monitor // MySQL database monitoring user
monitor_password Monitor // monitor MySQL database user password
</host>
debug 0
[root@monitor ~]#
3) Modify the client configuration file
master1 Configuration
[root@master1 ~]# cat /etc/mysql-mmm/mmm_agent.conf
include mmm_common.conf
this master1
master2 Configuration
[root@master2 ~]# cat /etc/mysql-mmm/mmm_agent.conf
include mmm_common.conf
this master2
slave1 Configuration
[root@slave1 ~]# cat /etc/mysql-mmm/mmm_agent.conf
include mmm_common.conf
this slave1
slave2 Configuration
[root@slave2 ~]# cat /etc/mysql-mmm/mmm_agent.conf
include mmm_common.conf
this slave2