Lab requirement: MySQ
Experimental requirements: Configure mysql-mmm to achieve mysql High Availability MySQL-MMM to achieve MySQL High Availability http://www.linuxidc.com/Linux/2014-02/96994.htm MySQ
Lab requirement: Configure mysql-mmm to achieve high availability of mysql
MySQL-MMM for MySQL High Availability
MySQL-MMM switching demonstration
Mysql proxy and MySQL-MMM achieve high availability of read/write splitting
Restore the MySQL-MMM Master from the REPLICATION_FAIL status
Use MySQL-MMM in CentOS to achieve high MySQL availability
Tutorial scheme:
1. Public Configuration
Prepare five RHEL6.4 operating system servers and install the MySQL database server software package.
Two database servers (192.168.10.10, 192.168.10.20) are configured as the master-master structure in mysql master-slave synchronization, and the cascade replication function is enabled.
Configure the other two servers (192.168.10.30, 192.168.10.40) as the master database and any master slave database server.
Verify that data can be synchronized normally
1. The configuration file of the master database server 192.168.10.10 is as follows:
Vim/etc/my. cnf
[Mysqld]
Server_id = 10
Log_bin = mysql-10-bin // The binlog must be enabled for the two master database servers with different name settings
Log_slave_updates = 1 // cascade replication allowed
Auto_increment_offset = 1 // specify the start value of the auto-increment Field
Auto_increment_increment = 2 // specify the step size of the auto-increment Field
Skip-name-resolve // do not parse the Host name
2. The configuration file of the master database server 192.168.10.20 is as follows:
Vim/etc/my. cnf
[Mysqld]
Server_id = 20
Log_bin = mysql-20-bin
Log_slave_updates = 1
Auto_increment_offset = 2 // The start value is different from that of the other primary node. This prevents repeated fields and cannot be written.
Auto_increment_increment = 2
Skip-name-resolve
3. Configure the slave Database Server 192.168.10.30
Vim/etc/my. cnf
[Mysqld]
Server_id = 30
Log_bin = mysql-30-bin
Log_slave_updates = 1
Skip-name-resolve
3. Configure the slave Database Server 192.168.10.40
Vim/etc/my. cnf
[Mysqld]
Server_id = 40
Log_bin = mysql-40-bin
Log_slave_updates = 1
Skip-name-resolve
4. Start 4 database services
5. perform synchronization authorization on two master database servers
Mysql> grant replication slave on *. * to slave @ "%" identified by "slave ";