Lars Marowsky-Bree wrote:
On 2008-07-15T08:13:25, Paul Walsh <[EMAIL PROTECTED]> wrote:
snip
(Stopping Apache would at least imply also stopping appsAlert, btw, as
the group has linear dependencies.)
Not a problem. appsAlert would send an email to say the resource was migrating away from the node and, when Apache
restarted there'd be a similar "takeover" email - keeps some people happy to be told when things go down/up :)
If I want to stop/start *just* Apache, is the best way to simply run
/usr/lib/ocf/resource.d/BCU/apache2 stop
/usr/lib/ocf/resource.d/BCU/apache2 start
No, not if you're doing monitoring; the cluster will find out and
restart the group.
The group, or just the resource? In theory, the script should be able to complete within the monitoring interval, so
the cluster wouldn't detect the resource was down.
http://www.linux-ha.org/v2/AdminTools/crm_resource seems to imply
crm_resource can be used to stop/start resources so I tried
crm_resource -r Apache -p target_role -v stopped
but nothing happened. Is this because its a member of a group and that
crm_resource would only be used to stop/start the entire group?
That will work, unless you have several target_roles defined, possibly
as meta_attributes? Newer versions will warn about that, but it's
impossible to say without seeing your configuration.
Should I expect to see something in the log file? When I executed that command, nothing changed in the GUI and there
was no indication in the log that the resource had stopped. A ps -ef confirmed that apache was still running.
CIB is attached for reference.
--
Paul Walsh
<cib generated="true" admin_epoch="0" have_quorum="true" ignore_dtd="false" num_peers="2" cib_feature_revision="2.0" ccm_transition="9" dc_uuid="27a8243c-0acd-4571-a4b5-7719e12e6ad0" epoch="236" num_updates="1" cib-last-written="Tue Jul 15 07:48:49 2008">
<configuration>
<crm_config>
<cluster_property_set id="cib-bootstrap-options">
<attributes>
<nvpair id="cib-bootstrap-options-dc-version" name="dc-version" value="2.1.3-node: 552305612591183b1628baa5bc6e903e0f1e26a3"/>
<nvpair name="last-lrm-refresh" id="cib-bootstrap-options-last-lrm-refresh" value="1216104528"/>
</attributes>
</cluster_property_set>
</crm_config>
<nodes>
<node uname="mercury" type="normal" id="79dcf3d6-3bfd-46fd-aa5d-979b4a023461">
<instance_attributes id="nodes-79dcf3d6-3bfd-46fd-aa5d-979b4a023461">
<attributes>
<nvpair name="standby" id="standby-79dcf3d6-3bfd-46fd-aa5d-979b4a023461" value="off"/>
</attributes>
</instance_attributes>
</node>
<node id="27a8243c-0acd-4571-a4b5-7719e12e6ad0" uname="titan" type="normal">
<instance_attributes id="nodes-27a8243c-0acd-4571-a4b5-7719e12e6ad0">
<attributes>
<nvpair id="standby-27a8243c-0acd-4571-a4b5-7719e12e6ad0" name="standby" value="off"/>
</attributes>
</instance_attributes>
</node>
</nodes>
<resources>
<group id="Moodle">
<meta_attributes id="Moodle_meta_attrs">
<attributes>
<nvpair id="Moodle_metaattr_target_role" name="target_role" value="started"/>
<nvpair id="Moodle_metaattr_ordered" name="ordered" value="true"/>
<nvpair id="Moodle_metaattr_collocated" name="collocated" value="true"/>
</attributes>
</meta_attributes>
<primitive id="web_dev" class="heartbeat" type="drbddisk" provider="heartbeat">
<instance_attributes id="web_dev_instance_attrs">
<attributes>
<nvpair id="bf0f5765-3a5a-4ddf-a89d-8a28c46dfdb4" name="1" value="web"/>
</attributes>
</instance_attributes>
<meta_attributes id="web_dev_meta_attrs">
<attributes>
<nvpair id="web_dev_metaattr_target_role" name="target_role" value="started"/>
</attributes>
</meta_attributes>
</primitive>
<primitive id="mysql_dev" class="heartbeat" type="drbddisk" provider="heartbeat">
<instance_attributes id="mysql_dev_instance_attrs">
<attributes>
<nvpair id="0dda0e20-93ca-4ebf-b729-575f9e7e8c5a" name="1" value="mysql"/>
</attributes>
</instance_attributes>
</primitive>
<primitive id="weblog_dev" class="heartbeat" type="drbddisk" provider="heartbeat">
<instance_attributes id="weblog_dev_instance_attrs">
<attributes>
<nvpair id="5df51f26-74e5-4c79-93c3-5b1dd57c1170" name="1" value="weblogs"/>
</attributes>
</instance_attributes>
</primitive>
<primitive id="web_fs" class="ocf" type="Filesystem" provider="heartbeat">
<instance_attributes id="web_fs_instance_attrs">
<attributes>
<nvpair id="5730f15b-2eef-4429-a09d-4404ce7c49fa" name="device" value="/dev/drbd0"/>
<nvpair id="8ba6523b-866d-43c1-b3b1-af98835f6fd0" name="directory" value="/ha/web"/>
<nvpair id="ed35d2b3-de38-453d-af90-0543bf8e5aac" name="fstype" value="ext3"/>
</attributes>
</instance_attributes>
<meta_attributes id="web_fs_meta_attrs">
<attributes>
<nvpair id="web_fs_metaattr_target_role" name="target_role" value="started"/>
</attributes>
</meta_attributes>
</primitive>
<primitive id="mysql_fs" class="ocf" type="Filesystem" provider="heartbeat">
<instance_attributes id="mysql_fs_instance_attrs">
<attributes>
<nvpair id="20612aee-a5c0-431f-83e2-6510bbc73a89" name="device" value="/dev/drbd1"/>
<nvpair id="356b423b-ac78-4de4-8394-1b2ef851784d" name="directory" value="/ha/mysql"/>
<nvpair id="085d4d94-1b7f-4564-bdaa-b64a34150b12" name="fstype"/>
</attributes>
</instance_attributes>
</primitive>
<primitive id="weblog_fs" class="ocf" type="Filesystem" provider="heartbeat">
<instance_attributes id="weblog_fs_instance_attrs">
<attributes>
<nvpair id="8c243bc3-6638-4954-b414-59ef170ff950" name="device" value="/dev/drbd2"/>
<nvpair id="16b24e81-dbd1-46ab-905b-2acbc4683c5b" name="directory" value="/ha/weblogs"/>
<nvpair id="0754e3ca-e7e4-4b1c-ad07-f139c7e628c1" name="fstype"/>
</attributes>
</instance_attributes>
</primitive>
<primitive id="fs_Alert" class="ocf" type="MailTo" provider="heartbeat">
<instance_attributes id="fs_Alert_instance_attrs">
<attributes>
<nvpair id="e3d8d3f1-aebe-4cea-9713-394a675e4dd5" name="email" value="[EMAIL PROTECTED]"/>
<nvpair id="f7301585-d4df-4bee-9fb6-e4f98f437d45" name="subject" value="MoodleFilesystems"/>
</attributes>
</instance_attributes>
</primitive>
<primitive id="ClusterIP" class="ocf" type="IPaddr2" provider="heartbeat">
<instance_attributes id="ClusterIP_instance_attrs">
<attributes>
<nvpair id="1d2b3d0a-fe1c-48dd-ac62-e0e474102616" name="ip" value="193.60.133.230"/>
<nvpair id="fe9e8430-2e2a-47a6-b47e-0d9feaa46d58" name="nic" value="eth0"/>
<nvpair id="7f6b7ed1-a43d-424f-9b24-abdba057ed67" name="cidr_netmask" value="24"/>
<nvpair id="d33288f5-1c39-4f7e-a144-a9dae4e9b2d0" name="broadcast" value="193.60.133.255"/>
</attributes>
</instance_attributes>
<operations>
<op id="0be31a7b-631d-436c-8a48-3a22096f20cd" name="monitor" interval="10s" timeout="5s" start_delay="0" disabled="false" on_fail="restart"/>
</operations>
<meta_attributes id="ClusterIP_meta_attrs">
<attributes>
<nvpair id="ClusterIP_metaattr_target_role" name="target_role" value="started"/>
</attributes>
</meta_attributes>
</primitive>
<primitive id="monitor" class="ocf" type="ClusterMon" provider="heartbeat">
<instance_attributes id="monitor_instance_attrs">
<attributes>
<nvpair id="262b42ea-c026-477b-9490-b3e687327862" name="htmlfile" value="/ha/web/status/index.html"/>
<nvpair id="d81a93af-33ab-4d7b-8b0e-8257f10191ac" name="user" value="moodle"/>
</attributes>
</instance_attributes>
<meta_attributes id="monitor_meta_attrs">
<attributes>
<nvpair id="monitor_metaattr_target_role" name="target_role" value="started"/>
</attributes>
</meta_attributes>
</primitive>
<primitive class="heartbeat" type="MySQL" provider="heartbeat" id="mysql">
<operations/>
<meta_attributes id="mysql_meta_attrs">
<attributes>
<nvpair name="target_role" id="mysql_metaattr_target_role" value="started"/>
</attributes>
</meta_attributes>
<instance_attributes id="mysql">
<attributes>
<nvpair id="mysql-target_role" name="target_role" value="stopped"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" type="apache2" provider="BCU" id="Apache">
<instance_attributes id="Apache_instance_attrs">
<attributes>
<nvpair id="2426053d-19f8-4888-9e2c-e1a369d020fc" name="configfile" value="/etc/apache2/apache2.conf"/>
</attributes>
</instance_attributes>
<meta_attributes id="Apache_meta_attrs">
<attributes>
<nvpair name="target_role" id="Apache_metaattr_target_role" value="started"/>
</attributes>
</meta_attributes>
<operations>
<op name="monitor" interval="5s" start_delay="0" disabled="false" on_fail="restart" id="b5876633-27e6-401b-b7dc-9dc1cef84763" timeout="15s" role="Started"/>
</operations>
<instance_attributes id="Apache">
<attributes>
<nvpair name="target_role" id="Apache-target_role" value="stopped"/>
</attributes>
</instance_attributes>
</primitive>
<primitive class="ocf" type="MailTo" provider="heartbeat" id="appsAlert">
<instance_attributes id="appsAlert_instance_attrs">
<attributes>
<nvpair name="email" id="31b31c55-f3ea-44b0-8d38-efdff8bd4209" value="[EMAIL PROTECTED]"/>
<nvpair id="d2941348-a825-4a17-8f38-6681a66ab874" name="subject" value="MoodleApps"/>
</attributes>
</instance_attributes>
</primitive>
</group>
</resources>
<constraints>
<rsc_location id="preferred_node" rsc="Moodle">
<rule id="prefered_preferred_node" score="0">
<expression attribute="#uname" id="411ec112-993b-4ab2-a975-89499863df57" operation="eq" value="mercury"/>
</rule>
</rsc_location>
<rsc_location id="Moodle:connected" rsc="Moodle">
<rule id="Moodle:connected:rule" score="-INFINITY" boolean_op="or">
<expression id="Moodle:connected:expr:undefined" attribute="pingd" operation="not_defined"/>
<expression id="Moodle:connected:expr:zero" attribute="pingd" operation="lte" value="0"/>
</rule>
</rsc_location>
</constraints>
</configuration>
</cib>
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems