pengmingde / mysql-master-ha

Automatically exported from code.google.com/p/mysql-master-ha
0 stars 0 forks source link

Undefined Scripts #55

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When I go to run a masterha_check_repl --conf=/etc/masterha_default.cnf 
everything is fine except at the end I get two warnings

Tue Feb 19 12:40:32 2013 - [warning] master_ip_failover_script is not defined.
Tue Feb 19 12:40:32 2013 - [warning] shutdown_script is not defined.

Here is my slightly modified config (for security's sake)

[server default]
# mysql user and password
user=root
password=password
ssh_user=root
manager_workdir=/var/log/masterha
remote_workdir=/var/log/masterha/mha1

[server1]
hostname=mysql01.tech.---.com

[server2]
hostname=mysql02.tech.---.com

master_ip_failover_script= /usr/local/bin/master_ip_failover
shutdown_script= /usr/local/bin/power_manager

The scripts are defined as follows

# cat /usr/local/bin/master_ip_failover 
#!/bin/bash

#Clear the screen
clear

openvz1="vz01"
servername1="mysql01"

openvz2="vz04"
servername2="mysql02"

ssh root@openvz1 'vzctl set 100 --ipdel 192.168.5.71 --save'
ssh root@servername1 'ifdown venet0:1'

ssh root@openvz2 'vzctl set 200 --ipadd 192.168.5.71 --save'
ssh root@servername2 'ifup venet0:1'

And this guy

cat /usr/local/bin/power_manager 
#!/bin/bash

#Clear the screen
clear

openvz1="vz01"
servername1="mysql01"

openvz2="vz04"
servername2="mysql02"

ssh root@servername1 'init 0'

Am i doing anything wrong here? Could someone point me in the right direction?

Original issue reported on code.google.com by thebign...@gmail.com on 19 Feb 2013 at 6:47

GoogleCodeExporter commented 9 years ago
The warning is (kind of) reminder message that there are helper scripts.
http://code.google.com/p/mysql-master-ha/wiki/Parameters#master_ip_failover_scri
pt
http://code.google.com/p/mysql-master-ha/wiki/Parameters#shutdown_script

If you don't need them, just ignore the message.

Original comment by Yoshinor...@gmail.com on 20 Feb 2013 at 5:53

GoogleCodeExporter commented 9 years ago
Thank you for your prompt response Mr. Yoshinori,

Would it be okay if I used the scripts that i've defined, or is that out of the 
question? Reason being is that our master and slave are virtualized through 
openVZ, and in order for the virtual IP address to change, the OpenVZ Host 
boxes need a set of commands sent to them to bring down the virtual ip address 
from the dead master and bring up the virtual IP address on the newly promoted 
master.  Alternatively, if I use your helper scripts, I just pass in the 
arguments after I define the location of it, correct? 

Thank You,
Ryan

Original comment by thebign...@gmail.com on 20 Feb 2013 at 4:49

GoogleCodeExporter commented 9 years ago
In your case, writing a virtual ip failover code within 
master_ip_failover_script would be fine. master_ip_failover_script is invoked 
before terminating the orig master and after promoting the new master. More 
details are described on wiki and sample code is included in Manager tarball.

Original comment by Yoshinor...@gmail.com on 20 Feb 2013 at 5:53

GoogleCodeExporter commented 9 years ago
Great, thank you so much!

Original comment by thebign...@gmail.com on 20 Feb 2013 at 8:46