[Blog recommendations] Microsoft Azure deployment MYSQL-MMM process details (1)
This blog post is from the Bkjia blog star, Mr. Li Xiaozhu. If you have any questions, please go to the blog homepage for an interactive discussion! Blog blog address: http://lixun.blog.51cto.com/4198640/1629177 |
MMM is the Master-Master Replication Manager for MySQL (mysql Master Replication Manager) A Scalable script suite for monitoring, failover, and management of mysql master/Master replication configurations (only one node can be written at any time ), this suite can also perform read load balancing on any number of slave servers with standard master-slave configurations, so you can use it to start virtual ip addresses on a group of slave servers. In addition, it also has scripts for implementing data backup and node-to-node re-synchronization.
MySQL itself does not provide a replication failover solution. The MMM solution can implement server failover to achieve high availability of mysql.
MMM project from Google: http://code.google.com/p/mysql-master-master
Official Website: http://mysql-mmm.org
The main features of MMM are provided by the following three scripts:
- L mmm_mond monitors the daemon process for all monitoring jobs and determines the removal of nodes.
- L mmm_agentd is a proxy daemon running on the mysql server. It is provided to the Monitoring node through a simple remote service set.
- L mmm_control manages the mmm_mond process through the command line
In the master-master environment of two nodes, MMM uses five IP addresses. Each node uses a fixed IP address, which will never change.
Two reader IPs (read-only) and one writer IP (updates). The following three IP addresses (two reader IP addresses and one Writer IP address) are migrated between the two nodes, the migration depends on the availability of the node.
Normally, the active master has two virtual ip addresses (reader and writer), and the standby master has a virtual ip address (reader ), if the active master fails, all the virtual IP addresses of reader and writer will be allocated 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 service is as follows:
- IP address role description
-
- 10.0.0.80 the write application connects to this ip address to write requests to the master database.
-
- 10.0.0.90 the read application connects to this ip address for read requests
-
- 10.0.0.100 the read application connects to this ip address for read requests
The deployment architecture is as follows:
Advantages and disadvantages of MySQL-MMM
Advantages: high availability, good scalability, automatic failover in case of faults. For master-master synchronization, only one database write operation is provided at the same time to ensure data consistency.
Disadvantage: The Monitor node is a single point and can be combined with Keepalived to achieve high availability.