aVersion Information
System Environment: CentOS 6.5 X64
MHA software version:
Mha4mysql-manager-0.56.tar.gz
Mha4mysql-node-0.56.tar.gz
MySQL Version:
Percona-server-5.6.22-rel71.0-726.linux.x86_64.tar.gz
twoInstallation Steps
Prerequisites,master-slave architecture (2.8.19 supports a master-one from the architecture, this article does not involve the construction of master-slave architecture)
(i) InstallationNodenode
(This configuration is in each operation on the DB node)
1.Installing the Software support Package
Yum-y Install Perl-extutils-makemakerperl-extutils-cbuilder Perl-cpan perl-dbi perl-dbd-mysql
2.Installing the Software
Perl makefile.pl
Make && make install
(ii) installationManager
The manager will also need to install node if it is deployed independently on a separate server , and install node after installing the Manager
1.Installing the Software support Package
Yum-y Install Perl-time-hiresperl-config-tiny
Cpan-i Parallel::forkmanager # middle requires interactive operation input Yes( need to resolve how to do non-interactive installation for automatic installation)
Cpan-i Log::D ispatch
2.Editing a configuration file
# MKDIR/ETC/MASTERHA
# mkdir-p/masterha/app1
# CP samples/conf/*/etc/masterha/
# CAT/ETC/MASTERHA/APP1.CNF
[Server default]
Manager_workdir=/masterha/app1
Manager_log=/masterha/app1/manager.log
User=mha
password=123456
Ssh_user=root
Repl_user=repl
repl_password=654321
Ping_interval=1
[Server1]
hostname=172.16.52.130
Candidate_master=1 # Set the elevation level, if each is 1, the failover main library is promoted in the configuration order
Master_binlog_dir= "/usr/local/mysql/data" # binlog Storage path for the Master library
[Server2]
hostname=172.16.52.131
Candidate_master=1
Master_binlog_dir= "/usr/local/mysql/data"
[Server3]
hostname=172.16.52.132
Candidate_master=1
Master_binlog_dir= "/usr/local/mysql/data"
Description
1)master_binlog_dir binlog log storage path corresponding to the main library
(c) no secret landing
Configuration Manager and node ssh each other without a password login, each DB needs to be configured
Ssh-keygen
Ssh-copy-id-i IP
(iv) database authorization
for each DB for authorization,( each node includes the manager needs to be configured )
Grant all on * * [email protected] ' 172.16.52.% ' identified by ' 123456 ';
Flush privileges;
in order to ensure subsequent rapid switching, the same user Authorization for replication on DB:
GRANT REPLICATION SLAVE on * * to ' repl ' @ ' 172.16.52.% ' identified by ' 654321 ';
Flush privileges;
(v) TestingSshConnection
Masterha_check_ssh--conf=/etc/masterha/app1.cnf
(vi) test master-Slave synchronization
Masterha_check_repl--conf=/etc/masterha/app1.cnf
(vii) Start/Stop management node process
Start the Management node process
Nohup Masterha_manager--conf=/etc/masterha/app1.cnf--ignore_last_failover &>/dev/null &
To close the management node process
Masterha_stop–conf=/etc/masterha/app1.cnf
(eight) log view
Tail-f/masterha/app1/manager.log
(ix) Fast switching
Through log filtering, the fault main library is quickly switched from the library.
Grep–i "Change"/masterha/app 1/manager.log # Whichever is the last change master
threeother
MHA Each failover, the process will stop, you need to manually restart the process, if the Lost main library does not switch from the library to re-copy the new main library, you need to change the manager 's configuration file, the process restarts, otherwise.
This article is from the "Floating Phoenix Year" blog, please be sure to keep this source http://liuzhanbin.blog.51cto.com/10060150/1641960
MHA Building--percona Server