Deploy MHA in MySQL 5.5

Source: Internet
Author: User

MHA is divided into management nodes and database nodes. database nodes are composed of mysql master-slave or master-slave nodes. When the master database fails, the management node will automatically upgrade from the master node to the master node; the role of the Management node is similar to the observer in the fast start failover in the Oracle database, but the mha upper layer can deploy the VIP through keepalive, and the program connects to the database using the VIP, so as to realize transparent failover of the background database.

The MHA node contains three scripts, depending on the perl module;
Save_binary_logs: stores and copies the binary logs of the master server;
Apply_diff_relay_logs: identifies differential relay log events and applies them to other salve servers;
Purge_relay_logs: clears the relay log file;
MHA nodes must be installed on all mysql servers, and MHA Management Servers must also be installed. The MHA management node module depends on the MHA node module;
The MHA management node manages the mysql server through ssh and executes the MHA node script. The MHA node depends on the perl DBD: mysql module;

This article introduces the environment, the operating system is rhel5.4
Master Database: 192.168.123.13/dg53.yang.com
Slave Database: 192.168.123.14/dg54.yang.com
Management node: 192.168.123.15/dg55.yang.com

Before starting, configure the time synchronization and name resolution between servers.

I. Install mha node on the database node

 
 
  1. [root@dg53 ~]# rpm -ivh http://dl.Fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm  
  2. Retrieving http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm  
  3. warning: /var/tmp/rpm-xfer.yqwfYT: Header V3 DSA signature: NOKEY, key ID 217521f6  
  4. Preparing...                ########################################### [100%]  
  5.    1:epel-release           ########################################### [100%]  
  6.  
  7. [root@dg53 ~]# ls /etc/yum.repos.d/  
  8. base.repo  epel.repo  epel-testing.repo  rhel-debuginfo.repo  
  9. [root@dg53 ~]# yum -y install perl-DBD-MySQL  ncftp  
  10. [root@dg53 ~]#  wget http://mysql-master-ha.googlecode.com/files/mha4mysql-node-0.52.tar.gz -P /usr/local/src/tarbag/  
  11. [root@dg53 ~]# cd /usr/local/src/tarbag/  
  12. [root@dg53 tarbag]# tar -zxvpf mha4mysql-node-0.52.tar.gz -C ../software/  
  13. [root@dg53 tarbag]# cd ../software/mha4mysql-node-0.52/  
  14. [root@dg53 mha4mysql-node-0.52]# perl Makefile.PL   
  15. [root@dg53 mha4mysql-node-0.52]# make && make install 
  • 1
  • 2
  • 3
  • 4
  • Next Page

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.