[Linux-HA] Linux-HA 2.0 LSB Resource
Andrew Beekhof
beekhof at gmail.com
Sat Oct 8 13:40:09 MDT 2005
On 10/7/05, Serge.Dubrouski at fjcomm.com <Serge.Dubrouski at fjcomm.com> wrote:
> Hello All -
>
> I'm trying to build a simple HA Cluster with one Virtual IP but I want to
> make it an LSB resource so it'll be monitored by Linux-HA through LSB init
> script. I created an lsbIPaddr init script that supports standard start,
> stop and monitor command and expect to receive one parameter through
> IP_ADDR environment variable.
unfortunately the LRM does not pass any environment variables to LSB scripts.
i thought it was going to, i still think it should, but it doesn't.
I also created a cib.xml file in according to
> this
> document:http://www.linux-ha.org/print.php/ClusterInformationBase_2fActions
> Here is my cib.xml file:
>
> <cib admin_epoch="0" have_quorum="true" num_peers="1"
> origin="aspapptest2.tonservices.com" cib_feature_revision="1"
> last_written="Fri Oct 7 10:31:07 2005"
> dc_uuid="b0762bad-ef02-4f9e-8caa-1694023be1c2" debug_source="finalize_join"
> ccm_transition="2" generated="true" epoch="23" num_updates="2348">
> <configuration>
> <crm_config>
> <nvpair id="require_quorum" name="require_quorum" value="true"/>
> <nvpair id="symmetric_cluster" name="symetric_cluster"
> value="false"/>
> </crm_config>
> <nodes>
> <node id="b0762bad-ef02-4f9e-8caa-1694023be1c2"
> uname="aspapptest3.tonservices.com" type="member"/>
> <node id="5eb542d9-bacd-41d2-acb0-3f8559e2e35c"
> uname="aspapptest2.tonservices.com" type="member"/>
> </nodes>
> <resources>
> <primitive class="lsb" type="lsbIPaddr" is_managed="true"
> id="ip_resource">
> <instance_attributes>
> <attributes>
> <nvpair name="ip" value="10.1.25.48"
> id="1ce74255-34e5-442e-a651-0837815ed611"/>
> </attributes>
> </instance_attributes>
> <operations>
> <op id="1" name="start" timeout="3s">
> <instance_attributes>
> <attributes>
> <nvpair name="IP_ADDR" value="10.1.25.48"
> id="8e77707c-d52e-4134-b698-ea50928ac4c4"/>
> </attributes>
> </instance_attributes>
> </op>
> <op id="2" name="stop" timeout="3s">
> <instance_attributes>
> <attributes>
> <nvpair name="IP_ADDR" value="10.1.25.48"
> id="5827adba-06ba-4325-834d-af4cc85fc869"/>
> </attributes>
> </instance_attributes>
> </op>
> <op id="3" name="monitor" interval="30s" timeout="3s">
> <instance_attributes>
> <attributes>
> <nvpair name="IP_ADDR" value="10.1.25.48"
> id="053450de-e7b8-4dbf-aeaa-812a35a99a9e"/>
> </attributes>
> </instance_attributes>
> </op>
> </operations>
> </primitive>
> </resources>
> <constraints>
> <rsc_location id="run_ip_resource" rsc="ip_resource">
> <rule id="pref_run_ip_resource" score="1000">
> <expression attribute="#uname" operation="eq"
> value="aspapptest2.tonservices.com"
> id="879a02ff-0589-4387-a42c-4197f0c4e515"/>
> </rule>
> <rule id="b4668e44-93f7-46d5-bf69-0646aea4724b" score="100">
> <expression attribute="#uname" operation="eq"
> value="aspapptest3.tonservices.com"
> id="f4608441-0709-4c41-83c6-0142c1180f76"/>
> </rule>
> </rsc_location>
> </constraints>
> </configuration>
> <status>
> <node_state uname="aspapptest3.tonservices.com" in_ccm="true"
> origin="do_lrm_query" id="b0762bad-ef02-4f9e-8caa-1694023be1c2"
> join="member" ha="active" expected="member"/>
> <node_state origin="do_lrm_query" join="member" ha="active"
> expected="down" shutdown="1128702663"
> id="5eb542d9-bacd-41d2-acb0-3f8559e2e35c">
> <lrm>
> <lrm_resources>
> <lrm_resource op_status="4" rc_code="1" rsc_state="stop_failed"
> last_op="stop" id="ip_resource">
> <lrm_rsc_op operation="start"
> transition_key="0:02a2cbaa-3f39-4389-9f19-02390e86a997"
> id="ip_resource_start_0" op_status="4" call_id="2" rc_code="1"
> origin="do_update_resource"
> transition_magic="4:0:02a2cbaa-3f39-4389-9f19-02390e86a997"
> rsc_state="start_failed"/>
> <lrm_rsc_op operation="stop" origin="do_update_resource"
> rsc_state="stop_failed" rc_code="1" op_status="4" id="ip_resource_stop_0"
> transition_key="18:02a2cbaa-3f39-4389-9f19-02390e86a997"
> transition_magic="4:18:02a2cbaa-3f39-4389-9f19-02390e86a997" call_id="20"/>
> </lrm_resource>
> </lrm_resources>
> </lrm>
> </node_state>
> </status>
> </cib>
>
> As I understand Linux-HA has to pass my IP_ADDR parameter as an environment
> variable to the LSB init script. Unfortunately this doens't work and init
> script receives no variables. Has anybody ever tried to work with LSB
> scripts, not OCF and could you point me out where is the problem?
>
> Thanks.
> Serge Dubrouski.
>
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>
More information about the Linux-HA
mailing list