MHA is a Mysql failover solution written by Mysql experts in Japan using Perl to ensure high Database Availability. Its function is to implement master Mysql failover within 0 to 30 s, MHA failover can help us solve the consistency problem of slave database data and maximize the recovery of data after the fault. This article is based on the Mysql master-slave architecture
MHA is a Mysql failover solution written by Mysql experts in Japan using Perl to ensure high Database Availability. Its function is to implement master Mysql failover within 0 to 30 s, MHA failover can help us solve the consistency problem of slave database data and maximize the recovery of data after the fault. This article is based on the Mysql master-slave architecture
MHA is a Mysql failover solution written by Mysql experts in Japan using Perl to ensure high Database Availability. Its function is to implement master Mysql failover within 0 to 30 s, MHA failover can help us solve the consistency problem of slave database data and maximize the recovery of data after the fault.
This article on the basis of the Mysql master-slave architecture configuration, please refer to the http://letong.me/mysql_backup.html
Install dependency packages and MHA
yum –y install perl-DBD-MySQL perl-Config-Tiny perl-Log-Dispatch perl-Parallel-ForkManagerrpm -Uvh https://mysql-master-ha.googlecode.com/files/mha4mysql-manager-0.55-0.el6.noarch.rpm
Configuration Management
Vi/etc/app1.conf
[Server default] user = root # mysql management Username password = 123ssh_user = rootrepl_user = repl # mysql master/Slave synchronization account repl_password = 123ping_interval = 1 # ping detection interval manager_workdir =/var/log/masterhamanager _ =/var/log/masterha/app1.logremote _ workdir =/var/log/masterha [server1] hostname = 192.168.1.1candidate _ master = 1 [server2] hostname = 192.168.1.2no _ master = 1
Detection and startup
masterha_check_ssh --conf=/etc/app1.confmasterha_check_repl --conf=/etc/app1.confmasterha_manager --conf=/etc/app1.conf
At this time, failover can be implemented, but it takes several seconds to configure keepalived to shorten this time.
Original article address: Mysql MHA high availability. Thank you for sharing it with me.