[Pacemaker] Issues with HA cluster for mysqld

David Parker dparker at utica.edu
Thu Aug 23 10:17:44 EDT 2012

On 08/23/2012 09:01 AM, Jake Smith wrote:
> ----- Original Message -----
>> From: "David Parker"<dparker at utica.edu>
>> To: pacemaker at oss.clusterlabs.org
>> Sent: Wednesday, August 22, 2012 2:49:32 PM
>> Subject: [Pacemaker] Issues with HA cluster for mysqld
>> Hello,
>> I'm trying to set up a 2-node, active-passive HA cluster for MySQL
>> using
>> heartbeat and Pacemaker.  The operating system is Debian Linux 6.0.5
>> 64-bit, and I am using the heartbeat packages installed via apt-get.
>> The servers involved are the SQL nodes of a running MySQL cluster, so
>> the only service I need HA for is the MySQL daemon (mysqld).
>> What I would like to do is have a single virtual IP address which
>> clients use to query MySQL, and have the IP and mysqld fail over to
>> the
>> passive node in the event of a failure on the active node.  I have
>> read
>> through a lot of the heartbeat and Pacemaker documentation, and here
>> are
>> the resources I have configured for the cluster:
>> * A custom LSB script for mysqld (compliant with Pacemaker's
>> requirements as outlined in the documentation)
>> * An iLO2-based STONITH device using riloe (both servers are HP
>> Proliant
>> DL380 G5)
>> * A virtual IP address for mysqld using IPaddr2
>> I believe I have configured everything correctly, but I'm not
>> positive.
>> Anyway, when I start heartbeat and pacemaker (/etc/init.d/heartbeat
>> start), everything seems to be ok.  However, the virtual IP never
>> comes
>> up, and the output of "crm_resource -LV" indicates that something is
>> wrong:
>> root at ha1:~# crm_resource -LV
>> crm_resource[28988]: 2012/08/22_14:41:23 WARN: unpack_rsc_op:
>> Processing
>> failed op stonith_start_0 on ha1: unknown error (1)
>>    stonith        (stonith:external/riloe) Started
>>    MysqlIP        (ocf::heartbeat:IPaddr2) Stopped
>>    mysqld (lsb:mysqld) Started
> It looks like you only have one STONITH resource defined... you need one per server (or to clone the one but that usually applies in blades not standalone servers).  And then you would add location constraints not allowing ha1's stonith to run on ha1 and ha2's stonith not run on ha2 (can't shoot yourself).  That way each server has the ability to stonith the other. Nothing *should* run if your stonith fails and you have stonith enabled.
> Jake

Thanks!  Can you clarify how I would go about putting those constraints 
in place?  I've been following Andrew's "Configuration Explained" 
document, and I think I have a grasp on most of these things, but it's 
not clear to me how I can constrain a STONITH device to only one node.  
Also, following the example in the documentation, I added these location 
constraints to the other resources:

<rsc_location id="loc-1" rsc="MysqlIP" node="ha1" score="200"/>
<rsc_location id="loc-2" rsc="MysqlIP" node="ha2" score="0"/>
<rsc_location id="loc-3" rsc="mysqld" node="ha1" score="200"/>
<rsc_location id="loc-4" rsc="mysqld" node="ha2" score="0"/>

I'm trying to make ha1 the preferred node for both mysqld and the 
virtual IP.  Do these look correct for that?

>> When I attempt to stop heartbeat and Pacemaker (/etc/init.d/heartbeat
>> stop) it says "Stopping High-Availability services:" and then hangs
>> for
>> about 5 minutes before finally stopping the services.
>> So, I'm left with a couple of questions.  Is there something wrong
>> with
>> my configuration?  Is there a reason why the HA services can't shut
>> down
>> in a timely manner?  Is there something else I need to do to get the
>> virtual IP working?  Thanks in advance for any help!

Would the misconfigured STONITH resources be causing the long shutdown 


P.S.  Here's an updated copy of my config:

<cib validate-with="pacemaker-1.0" crm_feature_set="3.0.1" 
have-quorum="1" admin_epoch="0" epoch="31" num_updates="4" 
cib-last-written="Wed Aug 22 15:23:08 2012" 
<cluster_property_set id="cib-bootstrap-options">
<nvpair id="cib-bootstrap-options-dc-version" name="dc-version" 
<nvpair id="cib-bootstrap-options-cluster-infrastructure" 
name="cluster-infrastructure" value="Heartbeat"/>
<nvpair id="cib-bootstrap-options-stonith-enabled" 
name="stonith-enabled" value="true"/>
<node id="1b48f410-44d1-4e89-8b52-ff23b32db1bc" uname="ha1" type="normal"/>
<node id="9790fe6e-67b2-4817-abf4-966b5aa6948c" uname="ha2" type="normal"/>
<primitive class="stonith" id="stonith" type="external/riloe">
<instance_attributes id="stonith-instance_attributes">
<nvpair id="stonith-instance_attributes-hostlist" name="hostlist" 
<nvpair id="stonith-instance_attributes-ilo_hostname" 
name="ilo_hostname" value=""/>
<nvpair id="stonith-instance_attributes-ilo_user" name="ilo_user" 
<nvpair id="stonith-instance_attributes-ilo_password" 
name="ilo_password" value="XXXXXXXX"/>
<nvpair id="stonith-instance_attributes-ilo_can_reset" 
name="ilo_can_reset" value="1"/>
<nvpair id="stonith-instance_attributes-ilo_protocol" 
name="ilo_protocol" value="2.0"/>
<nvpair id="stonith-instance_attributes-ilo_powerdown_method" 
name="ilo_powerdown_method" value="button"/>
<primitive class="ocf" id="MysqlIP" provider="heartbeat" type="IPaddr2">
<instance_attributes id="MysqlIP-instance_attributes">
<nvpair id="MysqlIP-instance_attributes-ip" name="ip" value=""/>
<nvpair id="MysqlIP-instance_attributes-cidr_netmask" 
name="cidr_netmask" value="32"/>
<op id="MysqlIP-monitor-30s" interval="30s" name="monitor"/>
<primitive id="mysqld" class="lsb" type="mysqld">
<rsc_location id="loc-1" rsc="MysqlIP" node="ha1" score="200"/>
<rsc_location id="loc-2" rsc="MysqlIP" node="ha2" score="0"/>
<rsc_location id="loc-3" rsc="mysqld" node="ha1" score="200"/>
<rsc_location id="loc-4" rsc="mysqld" node="ha2" score="0"/>
<node_state id="1b48f410-44d1-4e89-8b52-ff23b32db1bc" uname="ha1" 
ha="active" in_ccm="true" crmd="online" join="member" expected="member" 
crm-debug-origin="do_state_transition" shutdown="0">
<transient_attributes id="1b48f410-44d1-4e89-8b52-ff23b32db1bc">
<instance_attributes id="status-1b48f410-44d1-4e89-8b52-ff23b32db1bc">
<nvpair id="status-1b48f410-44d1-4e89-8b52-ff23b32db1bc-probe_complete" 
name="probe_complete" value="true"/>
name="fail-count-stonith" value="INFINITY"/>
name="last-failure-stonith" value="1345667934"/>
<lrm id="1b48f410-44d1-4e89-8b52-ff23b32db1bc">
<lrm_resource id="MysqlIP" type="IPaddr2" class="ocf" provider="heartbeat">
<lrm_rsc_op id="MysqlIP_monitor_0" operation="monitor" 
crm-debug-origin="build_active_RAs" crm_feature_set="3.0.1" 
call-id="3" rc-code="7" op-status="0" interval="0" last-run="1345666902" 
last-rc-change="1345666902" exec-time="20" queue-time="0" 
<lrm_resource id="mysqld" type="mysqld" class="lsb">
<lrm_rsc_op id="mysqld_monitor_0" operation="monitor" 
crm-debug-origin="build_active_RAs" crm_feature_set="3.0.1" 
call-id="4" rc-code="7" op-status="0" interval="0" last-run="1345666902" 
last-rc-change="1345666902" exec-time="20" queue-time="0" 
<lrm_resource id="stonith" type="external/riloe" class="stonith">
<lrm_rsc_op id="stonith_monitor_0" operation="monitor" 
crm-debug-origin="build_active_RAs" crm_feature_set="3.0.1" 
call-id="2" rc-code="7" op-status="0" interval="0" last-run="1345666902" 
last-rc-change="1345666902" exec-time="10" queue-time="0" 
<lrm_rsc_op id="stonith_start_0" operation="start" 
crm-debug-origin="build_active_RAs" crm_feature_set="3.0.1" 
call-id="5" rc-code="1" op-status="0" interval="0" last-run="1345666902" 
last-rc-change="1345666902" exec-time="5070" queue-time="0" 


Dave Parker
Systems Administrator
Utica College
Integrated Information Technology Services
(315) 792-3229
Registered Linux User #408177

More information about the Pacemaker mailing list