Build a mysql-mmm high-availability MySQL Cluster

Source: Internet
Author: User
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 ";

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.