Mysql-mmm High Availability

Source: Internet
Author: User
Tags db2 failover

  • MMM introduction
  • MMM (Master-master Replication Manager for MySQL) is a set of scripting programs that support dual-master failover and dual-master daily management. MMM is developed using the Perl language and is primarily used to monitor and manage MySQL Master-master (dual master) replication, which can be said to be the Master Master Replication Manager for MySQL. Although it is called double-master replication, but only one master is allowed to write at the same time in the business, and the other one provides partial read service to accelerate the preheating of the alternate master at the main switch time, it can be said that the MMM script program realizes the function of failover. On the other hand, its internal additional tool scripts can also implement read load balancing for multiple slave. A set of scalable scripting suites for monitoring, failover, and management of MySQL 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 group of replicated servers, in addition to a script that enables data backup and resynchronization between nodes.

    MMM provides both automatic and manual removal of the virtual IP of a server with high replication latency in a set of servers, as well as the ability to back up data, achieve data synchronization between two nodes, and more. Because MMM does not fully guarantee the consistency of data, MMM is suitable for the data consistency requirements are not very high, but also want to maximize the business availability of the scene. 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. For businesses that have a high level of conformance to data, it is highly recommended that you use MMM as a highly available architecture.

    Install update source

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo//可5台同时安装 更换源yum -y install epel-release  //进行eOpel更新yum clean all && yum makecache  四台MySQL 清空原有的 安装新的yum -y install mariadb-server mariadb  //安装MySQLsystemctl stop firewalld.service     //关闭服务器setenforce 0   //安全×××

    Modify the MySQL Master Profile 4 units are the same configuration except for the Service--id serial number

    #vi /etc/my.cnf  (9dd 删除原有的配置 添加下面的) [mysqld]log_error=/var/lib/mysql/mysql.errlog=/var/lib/mysql/mysql_log.loglog_slow_queries=/var/lib/mysql_slow_queris.logbinlog-ignore-db=mysql,information_schema  //不需要同步的数据库名称character_set_server=utf8log_bin=mysql_bin                  //开启binlog日志用于主从复制server_id=1                            //4台id设置不同log_slave_updates=truesync_binlog=1auto_increment_increment=2    //字段一次递增多少auto_increment_offset=1           //自增字段的起始值:1,3,5,7...等 奇数ID# systemctl start mariadb  //开启服务


    Installing yum-y install mysql-mmm* and configuring the

    # yum-y Install mysql-mmm*# cd/etc/mysql-mmm/# vi/etc/mysql-mmm/mmm_common.conf//Configure on all hosts ... 
      • Monitor server Configuration
        # cd /etc/mysql-mmm/# vi mmm_mon.confping_ips      192.168.100.10,192.168.100.11,192.168.100.12,192.168.100.13 //数据库服务器地址auto_set_online     10        //自动上线时间 10秒.....
      • Authorization for mmm_agent and mmm_moniter on all databases
        mysql> grant super, replication client, process on *.* to ‘mmm_agent‘@‘192.168.100.%‘ identified by ‘123456‘;mysql> grant replication client on *.* to ‘mmm_monitor‘@‘192.168.100.%‘ identified by ‘123456‘;mysql> flush privileges;   //刷新权限
      • Modify the mmm_agent.conf of all databases
        # vi /etc/mysql-mmm/mmm_agent.conf....this db1         //主1为db1、  主2为db2、   从1为db3 、  从2为db4


    Mysql-mmm High Availability

    Related Article

    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.