<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="sans-serif">Related thread: </font>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<a
href="http://oss.clusterlabs.org/pipermail/pacemaker/2011-December/012499.html">http://oss.clusterlabs.org/pipermail/pacemaker/2011-December/012499.html</a><br>
<br>
I'm going to setup failover for MySQL replication (1 master and 1
slave) follow this guide:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<a
href="https://github.com/jayjanssen/Percona-Pacemaker-Resource-Agents/blob/master/doc/PRM-setup-guide.rst">https://github.com/jayjanssen/Percona-Pacemaker-Resource-Agents/blob/master/doc/PRM-setup-guide.rst</a><br>
<br>
Here're the output of `crm configure show`:<br>
<br>
node serving-6192 \<br>
attributes p_mysql_mysql_master_IP="192.168.6.192"<br>
node svr184R-638.localdomain \<br>
attributes p_mysql_mysql_master_IP="192.168.6.38"<br>
primitive p_mysql ocf:percona:mysql \<br>
params config="/etc/my.cnf" pid="/var/run/mysqld/mysqld.pid"
socket="/var/lib/mysql/mysql.sock" replication_user="repl"
replication_passwd="x" test_user="test_user" test_passwd="x" \<br>
op monitor interval="5s" role="Master" OCF_CHECK_LEVEL="1" \<br>
op monitor interval="2s" role="Slave" timeout="30s"
OCF_CHECK_LEVEL="1" \<br>
op start interval="0" timeout="120s" \<br>
op stop interval="0" timeout="120s"<br>
primitive writer_vip ocf:heartbeat:IPaddr2 \<br>
params ip="192.168.6.8" cidr_netmask="32" \<br>
op monitor interval="10s" \<br>
meta is-managed="true"<br>
ms ms_MySQL p_mysql \<br>
meta master-max="1" master-node-max="1" clone-max="2"
clone-node-max="1" notify="true" globally-unique="false"
target-role="Master" is-managed="true"<br>
colocation writer_vip_on_master inf: writer_vip ms_MySQL:Master<br>
order ms_MySQL_promote_before_vip inf: ms_MySQL:promote
writer_vip:start<br>
property $id="cib-bootstrap-options" \<br>
dc-version="1.0.12-unknown" \<br>
cluster-infrastructure="openais" \<br>
expected-quorum-votes="2" \<br>
no-quorum-policy="ignore" \<br>
stonith-enabled="false" \<br>
last-lrm-refresh="1341801689"<br>
property $id="mysql_replication" \<br>
p_mysql_REPL_INFO="192.168.6.192|mysql-bin.000006|338"<br>
<br>
`crm_mon`:<br>
<br>
Last updated: Mon Jul 9 10:30:01 2012<br>
Stack: openais<br>
Current DC: serving-6192 - partition with quorum<br>
Version: 1.0.12-unknown<br>
2 Nodes configured, 2 expected votes<br>
2 Resources configured.<br>
============<br>
<br>
Online: [ serving-6192 svr184R-638.localdomain ]<br>
<br>
Master/Slave Set: ms_MySQL<br>
Masters: [ serving-6192 ]<br>
Slaves: [ svr184R-638.localdomain ]<br>
writer_vip (ocf::heartbeat:IPaddr2): Started serving-6192<br>
Editing `/etc/my.cnf` on the serving-6192 of wrong syntax to test
failover and it's working fine:<br>
- svr184R-638.localdomain being promoted to become the master<br>
- writer_vip switch to svr184R-638.localdomain<br>
<br>
Last updated: Mon Jul 9 10:35:57 2012<br>
Stack: openais<br>
Current DC: serving-6192 - partition with quorum<br>
Version: 1.0.12-unknown<br>
2 Nodes configured, 2 expected votes<br>
2 Resources configured.<br>
============<br>
<br>
Online: [ serving-6192 svr184R-638.localdomain ]<br>
<br>
Master/Slave Set: ms_MySQL<br>
Masters: [ svr184R-638.localdomain ]<br>
Stopped: [ p_mysql:0 ]<br>
writer_vip (ocf::heartbeat:IPaddr2): Started
svr184R-638.localdomain<br>
<br>
Failed actions:<br>
p_mysql:0_monitor_5000 (node=serving-6192, call=15, rc=7,
status=complete): not running<br>
p_mysql:0_demote_0 (node=serving-6192, call=22, rc=7,
status=complete): not running<br>
p_mysql:0_start_0 (node=serving-6192, call=26, rc=-2,
status=Timed Out): unknown exec error<br>
<br>
Remove the wrong syntax from `/etc/my.cnf` on serving-6192, and
restart corosync, what I would like to see is serving-6192 was
started as a new slave but it doesn't:<br>
<br>
Failed actions:<br>
p_mysql:0_start_0 (node=serving-6192, call=4, rc=1,
status=complete): unknown error<br>
<br>
Here're snippet of the logs which I'm suspecting:<br>
<br>
Jul 09 10:46:32 serving-6192 lrmd: [7321]: info: rsc:p_mysql:0:4:
start<br>
Jul 09 10:46:32 serving-6192 lrmd: [7321]: info: RA output:
(p_mysql:0:start:stderr) Error performing operation: The
object/attribute does not exist<br>
<br>
Jul 09 10:46:32 serving-6192 crm_attribute: [7420]: info: Invoked:
/usr/sbin/crm_attribute -N serving-6192 -l reboot --name readable -v
0 <br>
<br>
The strange thing is I can starting it manually:<br>
<br>
export OCF_ROOT=/usr/lib/ocf<br>
export OCF_RESKEY_config="/etc/my.cnf"<br>
export OCF_RESKEY_pid="/var/run/mysqld/mysqld.pid"<br>
export OCF_RESKEY_socket="/var/lib/mysql/mysql.sock"<br>
export OCF_RESKEY_replication_user="repl"<br>
export OCF_RESKEY_replication_passwd="x"<br>
export OCF_RESKEY_max_slave_lag="60"<br>
export OCF_RESKEY_evict_outdated_slaves="false"<br>
export OCF_RESKEY_test_user="test_user"<br>
export OCF_RESKEY_test_passwd="x"<br>
<br>
`sh -x /usr/lib/ocf/resource.d/percona/mysql start`:
<a class="moz-txt-link-freetext" href="http://fpaste.org/RVGh/">http://fpaste.org/RVGh/</a><br>
<br>
Did I make something wrong?<br>
<br>
<br>
</body>
</html>