Microsoft Azure Deployment Mysql-mmm (1) Install MySQL

Source: Internet
Author: User
Tags failover

MMM is Master-master Replication manager for MySQL (MySQL master replication Manager) a set of scalable scripting suites for monitoring, failover, and management of MySQL primary master replication configuration (only one node can be written at any time) , this suite can also read load Balancing on any number of slave servers that reside in the standard master and subordinate configuration, so you can use it to start a virtual IP on a set of replicated servers, in addition to a script that enables data backup and resynchronization between nodes.


MySQL itself does not provide replication failover solution, through the MMM solution can realize the server failover, so as to achieve high availability of MySQL.


MMM project from Google:http://code.google.com/p/mysql-master-master


The official website is: http://mysql-mmm.org


The main functions of MMM are provided by the following three scripts


L Mmm_mond is responsible for monitoring the monitoring daemon, determining the node removal and so on.


L MMM_AGENTD the agent daemon running on the MySQL server, provided to the monitoring node through a simple remote service set


L Mmm_control managing Mmm_mond processes from the command line

in a two-node master-master Environment,MMM uses 5 IPs . Each individual node uses a fixed IP, and the fixed IP will never change.

2 Reader IPs (read-only) and one writer IP (updates), followed by three IPs (2 reader IP and one Writer IP) is migrated between two nodes, and how it is migrated depends on the availability of the node.


under normal circumstances (no replication failures, no replication delays, etc.) the active Master has two virtual IPs (reader and writer), and the alternate master has a virtual IP (reader), if the active Master fails, all reader and writer virtual IPs are assigned to the standby Master.


The specific configuration information is as follows:

Role IP Address host name Server-id

Monitoring 10.0.0.6 Monitor-

Master1 10.0.0.4 DB1 1

Master2 10.0.0.5 DB2 2

Slave1 10.0.0.7 DB3 3


The service IP information in the business is as follows:

IP Address Role Description

The 10.0.0.80 write application connects the IP to the main library for writing requests

10.0.0.90 read application connects to the IP for reading requests

10.0.0.100 read application connects to the IP for reading requests


Deployment architectures such as:


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5D/18/wKiom1Uhauvyx1htAAFk2OH351E975.jpg "/>


Mysql-mmm Advantages and Disadvantages

Advantages: High availability, scalability, automatic failover, for master synchronization, at the same time only provide a database write operation, to ensure the consistency of the data.

Cons: The monitor node is a single point that can be combined with keepalived for high availability.


The specific deployment steps are as follows:

(1) host configuration

in the Azure Create a virtual network, and then create a virtual machine in the library, choosing the CentOS openlogic based 6.5

PS: Because MMM monitoring mechanism needs to check ping, make sure all virtual machines are under one vnet.


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5D/18/wKiom1UhauyiOvf5AAHIypmsYeo982.jpg "/>


At the same time complete the creation of four virtual machines, respectively, Master1, Master2, slave, monitor, such as:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5D/13/wKioL1UhbDDBc4juAAH2VYkagRE188.jpg "/>


use that XShell connected to VM

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5D/18/wKiom1Uhauyy385PAAL0y5r5-x4387.jpg "/>


First get root permission and change the root password, the following actions

Sudo Su-

Enter password

PASSWD Root

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5D/13/wKioL1UhbDHBwXSTAAPNWAQUA0I597.jpg "/>


Install the MySQL service with the Yum command on each server

# yum Install Mysql-server

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5D/18/wKiom1Uhau3zfKLeAANrmzq1D5g921.jpg "/>


Restart after installation is complete MYSQL Service

# Service Mysqld Restart

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5D/13/wKioL1UhbDKzyOCmAADcr76n5GE543.jpg "/>


To connect to MySQL, modify the MySQL root password as follows:

# Mysql-uroot

Use MySQL

Update user set Password=password (' [email protected] ') where user= ' root ';

Flush privileges;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5D/18/wKiom1Uhau6hHf_KAAJNkRD_eVo715.jpg "/>


Select User,host,password from Mysql.user

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5D/13/wKioL1UhbDLRnC1MAAL3KlU0fzY071.jpg "/>

This article is from "Li Xun Blog-Microsoft technology and Cloud" blog, make sure to keep this source http://lixun.blog.51cto.com/4198640/1629177

Microsoft Azure Deployment Mysql-mmm (1) Install MySQL

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.