MHA multi-VIP multiple MySQL instance support
First look at the Power_manager script
MHA Manager if the ability to SSH to master host, will call the Stopssh method, Stopssh method according to Master_pid_file to kill the MySQL instance of the process, whether it is kill success or failure, and finally return 10,
As for kill all MySQL instance code directly removed.
MHA Manager if you can not SSH to master host, will call the Stop method, because it is a MySQL multi-instance, the Stop method must not shutdown Master host, no matter how you extend the Stop method, and finally return 0, to tell MHA Manager launches failover.
This Power_manager script is only used to kill MySQL instances.
Expand the [Server Default] section of the parameter profile and add the following two parameters to tell MHA Manager to manage the VIP for the MySQL instance.
Master_vip_interface=eth0:2
master_vip=192.168.23.88
Add the Master_vip_interface and MASTER_VIP parameter item contents in the following three source files:
config.pm
mastermonitor.pm
masterfailover.pm
For the Master_ip_failover script, we also add these two parameters, and then remotely shutdown the VIP in Stopssh, startup VIP in Start.
In the automatic failover, the call to the Master_ip_failover script will append master_vip_interface and master_vip two parameters:
--check status phasefri jan 9 14:46:53 2015 - [info] checking master_ip_failover_script status:fri jan 9 14:46:53 2015 - [info] /script/mha/master_ip_failover --command=status --ssh_user=root - -orig_master_host=mha1 --orig_master_ip=192.168.23.64 --orig_master_port=3306 --master_vip= 192.168.23.88 --master_vip_interface=eth0:2 --stop or stopssh phase Uninstalling Vipfri jan 9 14:48:41 2015 - [info] forcing shutdown so that applications never connect to the current master. fri jan 9 14:48:41 2015 - [info] executing master ip deactivation script:fri jan 9 14:48:41 2015 - [info] /script/mha/master_ip_failover --orig_master_host=mha1 --orig_master_ip=192.168.23.64 --orig_master_port=3306 --master_vip=192.168.23.88 --master_vip_interface=eth0:2 --command=stopssh --ssh_user=root or Fri jan 9 16:14:55 2015 - [info] Forcing shutdown so that Applications never connect to the current master. fri jan 9 16:14:55 2015 - [info] executing master ip deactivation script:fri jan 9 16:14:55 2015 - [info] /script/mha/master_ip_failover --orig_master_host=mha1 --orig_master_ip=192.168.23.64 -- Orig_master_port=3306 --master_vip=192.168.23.88 --master_vip_interface=eth0:2 --command= stop --start phase Add Vipfri jan 9 14:48:44 2015 - [info] executing master ip activate scRipt:fri jan 9 14:48:44 2015 - [info] /script/mha/master_ ip_failover --command=start --ssh_user=root --orig_master_host=mha1 --orig_master_ip= 192.168.23.64 --orig_master_port=3306 --new_master_host=mha2 --new_master_ip=192.168.23.66 --new_master_port=3306 --new_master_user= ' root ' --new_master_password= ' 123QWE3306 ' -- Master_vip=192.168.23.88 --master_vip_interface=eth0:2 set read_only=0 on the new master. ENABLING THE VIP - 192.168.23.88 ON THE NEW MASTER - MHA2: Eth0:2.
This article is from the "Days together with it" blog, so be sure to keep this source http://raugher.blog.51cto.com/3472678/1601289
MHA multi-VIP multiple MySQL instance support