[Pacemaker] mysql resource agent

Andrew Beekhof andrew at beekhof.net
Wed Oct 29 21:18:48 UTC 2014


> On 30 Oct 2014, at 5:57 am, Keith Ouellette <KeithO at fibermountain.com> wrote:
> 
> I am running two servers (Ubuntu 14.04 LTS) as an HA setup for an application that uses mysql. I am using DRBD to replicate the data between the servers and am able to manually start mysql on each server. The DRBD replication is also working fine and Pacemaker  (version 1.1.10) seems to handle that properly. I then created a resource for mysql to start it on the active node.
>  
> All this I am doing with LCMC (although, I hope that should not matter). When I start the mysql resource, it shows that it is started:
>  
> fmadmin at AOS1:/$ sudo crm status
> Last updated: Wed Oct 29 14:43:31 2014
> Last change: Wed Oct 29 13:56:10 2014 via crm_resource on AOS1
> Stack: corosync
> Current DC: AOS1 (172655985) - partition with quorum
> Version: 1.1.10-42f2063
> 2 Nodes configured
> 5 Resources configured
>  
>  
> Online: [ AOS1 AOS2 ]
>  
> Master/Slave Set: ms_drbd_1 [res_drbd_1]
>      Masters: [ AOS1 ]
>      Slaves: [ AOS2 ]
> res_Filesystem_1       (ocf::heartbeat:Filesystem):    Started AOS1
> res_IPaddr2_1  (ocf::heartbeat:IPaddr2):       Started AOS1
> res_mysql_1    (service:mysql):        Started AOS1
>  
> However, the service did not start:
>  
> fmadmin at AOS1:/$ sudo service mysql status
> mysql stop/waiting
>  
>  
> I see the following error in syslog:
>  
> Oct 29 13:56:12 AOS1 crmd[40578]:    error: crm_xml_err: XML Error: Entity: line 1: parser error : Start tag expected, '<' not found
> Oct 29 13:56:12 AOS1 crmd[40578]:    error: crm_xml_err: XML Error: Usage: /etc/init.d/mysql start|stop|restart|reload|force-reload|status
> Oct 29 13:56:12 AOS1 crmd[40578]:    error: crm_xml_err: XML Error: ^
> Oct 29 13:56:12 AOS1 crmd[40578]:  warning: string2xml: Parsing failed (domain=1, level=3, code=4): Start tag expected, '<' not found
> Oct 29 13:56:12 AOS1 crmd[40578]:    error: crm_abort: string2xml: Forked child 21538 to record non-fatal assert at xml.c:589 : Cannot parse an empty string
> Oct 29 13:56:12 AOS1 /etc/mysql/debian-start[21533]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignored
> Oct 29 13:56:12 AOS1 /etc/mysql/debian-start[21533]: Looking for 'mysql' as: /usr/bin/mysql
> Oct 29 13:56:12 AOS1 /etc/mysql/debian-start[21533]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
> Oct 29 13:56:12 AOS1 /etc/mysql/debian-start[21533]: This installation of MySQL is already upgraded to 5.5.40, use --force if you still need to run mysql_upgrade
> Oct 29 13:56:12 AOS1 /etc/mysql/debian-start[21550]: Checking for insecure root accounts.
> Oct 29 13:56:12 AOS1 /etc/mysql/debian-start[21555]: Triggering myisam-recover for all MyISAM tables
> Oct 29 13:56:12 AOS1 crmd[40578]:    error: get_rsc_restart_list: Metadata for (null)::service:mysql is not valid XML
> Oct 29 13:56:12 AOS1 crmd[40578]:   notice: process_lrm_event: LRM operation res_mysql_1_start_0 (call=334, rc=0, cib-update=84, confirmed=true) ok
> Oct 29 13:56:12 AOS1 crmd[40578]:   notice: te_rsc_command: Initiating action 43: monitor res_mysql_1_monitor_15000 on AOS1 (local)
>  
>  
> It looks like the resource agent is giving a bad command?

Thats the metadata command failing, but the agent start gets started: "LRM operation res_mysql_1_start_0 ... ok"

> Or at least that is what it appears to be. Any ideas?

You might be better off using the OCF agent instead.  Its a bit smarter.

>  
> Here is a dump of the configuration:
>  
> fmadmin at AOS1:/$ sudo cibadmin --query
> <cib epoch="210" num_updates="3" admin_epoch="0" validate-with="pacemaker-1.2" crm_feature_set="3.0.7" cib-last-written="Wed Oct 29 13:56:10 2014" update-origin="AOS1" update-client="crm_resource" have-quorum="1" dc-uuid="172655985">
>   <configuration>
>     <crm_config>
>       <cluster_property_set id="cib-bootstrap-options">
>         <nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
>         <nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="1.1.10-42f2063"/>
>         <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
>         <nvpair id="cib-bootstrap-options-cluster-infrastructure" name="cluster-infrastructure" value="corosync"/>
>         <nvpair id="cib-bootstrap-options-last-lrm-refresh" name="last-lrm-refresh" value="1414603959"/>
>       </cluster_property_set>
>     </crm_config>
>     <nodes>
>       <node id="172655986" uname="AOS2"/>
>       <node id="172655985" uname="AOS1"/>
>     </nodes>
>     <resources>
>       <master id="ms_drbd_1">
>         <meta_attributes id="ms_drbd_1-meta_attributes">
>           <nvpair id="ms_drbd_1-meta_attributes-clone-max" name="clone-max" value="2"/>
>           <nvpair id="ms_drbd_1-meta_attributes-notify" name="notify" value="true"/>
>           <nvpair id="ms_drbd_1-meta_attributes-interleave" name="interleave" value="true"/>
>         </meta_attributes>
>         <primitive id="res_drbd_1" class="ocf" provider="linbit" type="drbd">
>           <instance_attributes id="res_drbd_1-instance_attributes">
>             <nvpair id="nvpair-res_drbd_1-drbd_resource" name="drbd_resource" value="r0"/>
>           </instance_attributes>
>           <operations id="res_drbd_1-operations">
>             <op interval="0" id="op-res_drbd_1-start" name="start" timeout="240"/>
>             <op interval="0" id="op-res_drbd_1-promote" name="promote" timeout="90"/>
>             <op interval="0" id="op-res_drbd_1-demote" name="demote" timeout="90"/>
>             <op interval="0" id="op-res_drbd_1-stop" name="stop" timeout="100"/>
>             <op id="op-res_drbd_1-monitor" name="monitor" interval="10" timeout="20" start-delay="0"/>
>             <op interval="0" id="op-res_drbd_1-notify" name="notify" timeout="90"/>
>           </operations>
>           <meta_attributes id="res_drbd_1-meta_attributes"/>
>         </primitive>
>       </master>
>       <primitive id="res_Filesystem_1" class="ocf" provider="heartbeat" type="Filesystem">
>         <instance_attributes id="res_Filesystem_1-instance_attributes">
>           <nvpair id="nvpair-res_Filesystem_1-device" name="device" value="/dev/drbd/by-res/r0/0"/>
>           <nvpair id="nvpair-res_Filesystem_1-directory" name="directory" value="/var/lib/mysql/data"/>
>           <nvpair id="nvpair-res_Filesystem_1-fstype" name="fstype" value="ext4"/>
>         </instance_attributes>
>         <operations id="res_Filesystem_1-operations">
>           <op interval="0" id="op-res_Filesystem_1-start" name="start" timeout="60"/>
>           <op interval="0" id="op-res_Filesystem_1-stop" name="stop" timeout="60"/>
>           <op id="op-res_Filesystem_1-monitor" name="monitor" interval="20" timeout="40" start-delay="0"/>
>           <op interval="0" id="op-res_Filesystem_1-notify" name="notify" timeout="60"/>
>         </operations>
>         <meta_attributes id="res_Filesystem_1-meta_attributes"/>
>       </primitive>
>       <primitive id="res_IPaddr2_1" class="ocf" provider="heartbeat" type="IPaddr2">
>         <instance_attributes id="res_IPaddr2_1-instance_attributes">
>           <nvpair id="nvpair-res_IPaddr2_1-ip" name="ip" value="10.74.133.120"/>
>           <nvpair id="nvpair-res_IPaddr2_1-cidr_netmask" name="cidr_netmask" value="24"/>
>         </instance_attributes>
>         <operations id="res_IPaddr2_1-operations">
>           <op interval="0" id="op-res_IPaddr2_1-start" name="start" timeout="20"/>
>           <op interval="0" id="op-res_IPaddr2_1-stop" name="stop" timeout="20"/>
>           <op id="op-res_IPaddr2_1-monitor" name="monitor" interval="10" timeout="20" start-delay="0"/>
>         </operations>
>         <meta_attributes id="res_IPaddr2_1-meta_attributes"/>
>       </primitive>
>       <primitive id="res_mysql_1" class="service" type="mysql">
>         <operations id="res_mysql_1-operations">
>           <op interval="0" id="op-res_mysql_1-start" name="start" timeout="15"/>
>           <op interval="0" id="op-res_mysql_1-stop" name="stop" timeout="15"/>
>           <op id="op-res_mysql_1-monitor" name="monitor" interval="15" timeout="15" start-delay="15"/>
>         </operations>
>         <meta_attributes id="res_mysql_1-meta_attributes">
>           <nvpair id="res_mysql_1-meta_attributes-target-role" name="target-role" value="started"/>
>         </meta_attributes>
>       </primitive>
>     </resources>
>     <constraints>
>       <rsc_colocation id="col_res_Filesystem_1_ms_drbd_1" score="INFINITY" with-rsc-role="Master" rsc="res_Filesystem_1" with-rsc="ms_drbd_1"/>
>       <rsc_order id="ord_ms_drbd_1_res_Filesystem_1" score="INFINITY" first-action="promote" then-action="start" first="ms_drbd_1" then="res_Filesystem_1"/>
>       <rsc_colocation id="col_res_IPaddr2_1_res_Filesystem_1" score="INFINITY" rsc="res_IPaddr2_1" with-rsc="res_Filesystem_1"/>
>       <rsc_order id="ord_res_Filesystem_1_res_IPaddr2_1" score="INFINITY" first="res_Filesystem_1" then="res_IPaddr2_1"/>
>       <rsc_colocation id="col_res_mysql_1_res_IPaddr2_1" score="INFINITY" rsc="res_mysql_1" with-rsc="res_IPaddr2_1"/>
>       <rsc_order id="ord_res_IPaddr2_1_res_mysql_1" score="INFINITY" first="res_IPaddr2_1" then="res_mysql_1"/>
>     </constraints>
>     <rsc_defaults>
>       <meta_attributes id="rsc-options"/>
>     </rsc_defaults>
>   </configuration>
>   <status>
>     <node_state id="172655985" uname="AOS1" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
>       <lrm id="172655985">
>         <lrm_resources>
>           <lrm_resource id="res_IPaddr2_1" type="IPaddr2" class="ocf" provider="heartbeat">
>             <lrm_rsc_op id="res_IPaddr2_1_last_failure_0" operation_key="res_IPaddr2_1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="6:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:0;6:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="239" rc-code="0" op-status="0" interval="0" last-run="1414602513" last-rc-change="1414602513" exec-time="329" queue-time="1" op-digest="7f04d9658437ab9175a91b9f55323554"/>
>             <lrm_rsc_op id="res_IPaddr2_1_monitor_10000" operation_key="res_IPaddr2_1_monitor_10000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="41:58:0:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:0;41:58:0:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="249" rc-code="0" op-status="0" interval="10000" last-rc-change="1414602514" exec-time="137" queue-time="0" op-digest="d7b2c923b15841dad31e4a017ffc8994"/>
>           </lrm_resource>
>           <lrm_resource id="res_Filesystem_1" type="Filesystem" class="ocf" provider="heartbeat">
>             <lrm_rsc_op id="res_Filesystem_1_last_failure_0" operation_key="res_Filesystem_1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="5:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:0;5:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="237" rc-code="0" op-status="0" interval="0" last-run="1414602513" last-rc-change="1414602513" exec-time="430" queue-time="0" op-digest="4abfd90c648656839a548d5fd571549e"/>
>             <lrm_rsc_op id="res_Filesystem_1_monitor_20000" operation_key="res_Filesystem_1_monitor_20000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="38:58:0:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:0;38:58:0:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="247" rc-code="0" op-status="0" interval="20000" last-rc-change="1414602514" exec-time="159" queue-time="0" op-digest="f4c52ea5791702decf57d3bc7d72019a"/>
>           </lrm_resource>
>           <lrm_resource id="res_drbd_1" type="drbd" class="ocf" provider="linbit">
>             <lrm_rsc_op id="res_drbd_1_last_failure_0" operation_key="res_drbd_1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="4:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:8;4:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="235" rc-code="8" op-status="0" interval="0" last-run="1414602513" last-rc-change="1414602513" exec-time="553" queue-time="0" op-digest="c0e018b73fdf522b6cdd355e125af15e"/>
>           </lrm_resource>
>           <lrm_resource id="res_mysql_1" type="mysql" class="service">
>             <lrm_rsc_op id="res_mysql_1_last_0" operation_key="res_mysql_1_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="42:77:0:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:0;42:77:0:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="334" rc-code="0" op-status="0" interval="0" last-run="1414605370" last-rc-change="1414605370" exec-time="2193" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
>             <lrm_rsc_op id="res_mysql_1_monitor_15000" operation_key="res_mysql_1_monitor_15000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="43:77:0:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:0;43:77:0:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="337" rc-code="0" op-status="0" interval="15000" last-rc-change="1414605387" exec-time="29" queue-time="15001" op-digest="02a5bcf940fc8d3239701acb11438d6a"/>
>           </lrm_resource>
>         </lrm_resources>
>       </lrm>
>       <transient_attributes id="172655985">
>         <instance_attributes id="status-172655985">
>           <nvpair id="status-172655985-master-res_drbd_1" name="master-res_drbd_1" value="10000"/>
>           <nvpair id="status-172655985-probe_complete" name="probe_complete" value="true"/>
>           <nvpair id="status-172655985-last-failure-res_mysql_1" name="last-failure-res_mysql_1" value="1414603330"/>
>         </instance_attributes>
>       </transient_attributes>
>     </node_state>
>     <node_state id="172655986" uname="AOS2" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member">
>       <lrm id="172655986">
>         <lrm_resources>
>           <lrm_resource id="res_IPaddr2_1" type="IPaddr2" class="ocf" provider="heartbeat">
>             <lrm_rsc_op id="res_IPaddr2_1_last_0" operation_key="res_IPaddr2_1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="11:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:7;11:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="184" rc-code="7" op-status="0" interval="0" last-run="1414602513" last-rc-change="1414602513" exec-time="119" queue-time="1" op-digest="7f04d9658437ab9175a91b9f55323554"/>
>           </lrm_resource>
>           <lrm_resource id="res_Filesystem_1" type="Filesystem" class="ocf" provider="heartbeat">
>             <lrm_rsc_op id="res_Filesystem_1_last_0" operation_key="res_Filesystem_1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="10:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:7;10:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="182" rc-code="7" op-status="0" interval="0" last-run="1414602513" last-rc-change="1414602513" exec-time="161" queue-time="0" op-digest="4abfd90c648656839a548d5fd571549e"/>
>           </lrm_resource>
>           <lrm_resource id="res_drbd_1" type="drbd" class="ocf" provider="linbit">
>             <lrm_rsc_op id="res_drbd_1_last_failure_0" operation_key="res_drbd_1_monitor_0" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="9:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:0;9:57:7:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="180" rc-code="0" op-status="0" interval="0" last-run="1414602513" last-rc-change="1414602513" exec-time="221" queue-time="0" op-digest="c0e018b73fdf522b6cdd355e125af15e"/>
>             <lrm_rsc_op id="res_drbd_1_monitor_10000" operation_key="res_drbd_1_monitor_10000" operation="monitor" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="11:58:0:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:0;11:58:0:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="192" rc-code="0" op-status="0" interval="10000" last-rc-change="1414602514" exec-time="72" queue-time="0" op-digest="db2fb3216fa7207fdc0b2bf31bbd09c1"/>
>           </lrm_resource>
>           <lrm_resource id="res_mysql_1" type="mysql" class="service">
>             <lrm_rsc_op id="res_mysql_1_last_0" operation_key="res_mysql_1_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.0.7" transition-key="42:72:0:92c79007-7c90-4700-8214-0f89457a3dd7" transition-magic="0:0;42:72:0:92c79007-7c90-4700-8214-0f89457a3dd7" call-id="212" rc-code="0" op-status="0" interval="0" last-run="1414604049" last-rc-change="1414604049" exec-time="2078" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/>
>           </lrm_resource>
>         </lrm_resources>
>       </lrm>
>       <transient_attributes id="172655986">
>         <instance_attributes id="status-172655986">
>           <nvpair id="status-172655986-master-res_drbd_1" name="master-res_drbd_1" value="10000"/>
>           <nvpair id="status-172655986-probe_complete" name="probe_complete" value="true"/>
>         </instance_attributes>
>       </transient_attributes>
>     </node_state>
>   </status>
> </cib>
> <fm-logo69d803.jpeg>
> Keith Ouellette
> 
> KeithO at fibermountain.com
> 
> 700 West Johnson Avenue
> Cheshire, CT06410
> www.fibermountain.com	<redlineef0ed4.jpeg>	P. (203) 806-4046
> C. (860) 810-4877
> F. (845) 358-7882	
> Disclaimer: The information contained in this communication is confidential, may be privileged and is intended for the exclusive use of the above named addressee(s). If you are not the intended recipient(s), you are expressly prohibited from copying, distributing, disseminating, or in any other way using any information contained within this communication. If you have received this communication in error, please contact the sender by telephone or by response via mail. We have taken precautions to minimize the risk of transmitting software viruses, but we advise you to carry out your own virus checks on this message, as well as any attachments. We cannot accept liability for any loss or damage caused by software viruses.
> 
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
> 
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs: http://bugs.clusterlabs.org





More information about the Pacemaker mailing list