On Thu, Apr 26, 2012 at 1:17 PM, dong he <[email protected]> wrote:
> Hi,
>      recently I'm clustering the OpenSIPS with two Ubuntu computers.
> I did it step by step and used the tutorial :
> http://anders.com/cms/259/Linux.Tutorial/OpenSer/Heartbeat.v2.0
> But unfortunately I still met so many problems.
>
> The follows are my configuration files:
> cib.xml
>
> <cib validate-with="transitional-0.6" crm_feature_set="3.0.1"
> have-quorum="1" admin_epoch="0" epoch="13" num_updates="0"
> cib-last-written="Wed Apr 25 19:06:24 2012"
> dc-uuid="1ca0c19b-5955-42f9-9131-b200c7c0d8ca">
>  <configuration>
>    <crm_config>
>      <cluster_property_set id="cluster-property-set">
>        <attributes>
>          <nvpair id="short_resource_names" name="short_resource_names"
> value="true"/>
>          <nvpair id="pe-input-series-max" name="pe-input-series-max"
> value="-1"/>
>          <nvpair id="default-resource-stickiness"
> name="default-resource-stickiness" value="10"/>
>          <nvpair id="default-resource-failure-stickiness"
> name="default-resource-failure-stickiness" value="-10"/>
>          <nvpair id="start-failure-is-fatal" name="start-failure-is-fatal"
> value="false"/>
>        </attributes>
>      </cluster_property_set>
>      <cluster_property_set id="cib-bootstrap-options">
>        <attributes>
>          <nvpair id="cib-bootstrap-options-last-lrm-refresh"
> name="last-lrm-refresh" value="1194982799"/>
>          <nvpair id="cib-bootstrap-options-dc-version" name="dc-version"
> value="1.0.9-da7075976b5ff0bee71074385f8fd02f296ec8a3"/>
>          <nvpair id="cib-bootstrap-options-cluster-infrastructure"
> name="cluster-infrastructure" value="Heartbeat"/>
>        </attributes>
>      </cluster_property_set>
>    </crm_config>
>    <nodes>
>      <node id="1ca0c19b-5955-42f9-9131-b200c7c0d8ca" uname="opensips1"
> type="normal"/>
>      <node id="e1044f5c-c3a6-44b6-84de-8513b2f7df90" uname="opensips2"
> type="normal"/>
>    </nodes>
>    <resources>
>      <group id="IPaddr2_OpenSIPS_group">
>        <primitive id="IPaddr2-10.120.89.222" class="ocf" type="IPaddr2"
> provider="heartbeat">
>          <operations>
>            <op id="ipaddr2-10.120.89.222-monitor" name="monitor"
> interval="5s" timeout="3s"/>
>          </operations>
>          <instance_attributes id="IPaddr2-10.120.89.222-attributes">
>            <attributes>
>              <nvpair id="ipaddr2-10.120.89.222-ip" name="ip"
> value="10.120.89.222"/>
>              <nvpair id="ipaddr2-10.120.89.222-broadcast" name="broadcast"
> value="10.120.89.255"/>
>              <nvpair id="ipaddr2-10.120.89.222-nic" name="nic"
> value="eth0"/>
>              <nvpair id="ipaddr2-10.120.89.222-cidr_netmask"
> name="cidr_netmask" value="24"/>
>            </attributes>
>          </instance_attributes>
>        </primitive>
>        <primitive id="IPaddr2-192.168.56.199" class="ocf" type="IPaddr2"
> provider="heartbeat">
>          <operations>
>            <op id="ipaddr2-1192.168.56.199-monitor" name="monitor"
> interval="5s" timeout="3s"/>
>          </operations>
>          <instance_attributes id="IPaddr2-192.168.56.199-attributes">
>            <attributes>
>              <nvpair id="ipaddr2-192.168.56.199-ip" name="ip"
> value="192.168.56.199"/>
>              <nvpair id="ipaddr2-192.168.56.199-broadcast"
> name="broadcast" value="192.168.56.255"/>
>              <nvpair id="ipaddr2-192.168.56.199-nic" name="nic"
> value="eth1"/>
>              <nvpair id="ipaddr2-192.168.56.199-cidr_netmask"
> name="cidr_netmask" value="24"/>
>            </attributes>
>          </instance_attributes>
>        </primitive>
>        <primitive id="OpenSIPS" class="ocf" type="OpenSIPS" provider="
> anders.com">
>          <operations>
>            <op id="opensips-start" name="start" timeout="20s"/>
>            <op id="opensips-stop" name="stop" timeout="3s"/>
>            <op id="opensips-monitor" name="monitor" interval="10s"
> timeout="6s"/>
>          </operations>
>        </primitive>
>      </group>
>    </resources>
>    <constraints>
>      <rsc_location id="OpenSIPS_resource_location" rsc="OpenSIPS">
>        <rule id="rule_opensips1" score="100">
>          <expression id="expression_uname_eq_opensips1" attribute="#uname"
> operation="eq" value="opensips1"/>
>        </rule>
>        <rule id="rule_opensips2" score="10">
>          <expression id="expression_uname_eq_opensips2" attribute="#uname"
> operation="eq" value="opensips2"/>
>        </rule>
>      </rsc_location>
>    </constraints>
>  </configuration>
> </cib>
>
>
> OpenSIPS script:
>
> #!/bin/sh
> # Initialization:
> . /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
> usage() {
>  cat <<END
>        usage: $0 {start|stop|status|monitor|meta-data|validate-all}
> END
> }
> meta_data() {
>  cat <<END
> <?xml version="1.0"?>
> <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
>  <resource-agent name="OpenSIPS">
>  <version>1.0</version>
>  <longdesc lang="en">
>  Resource Agent for the OpenSIPS SIP Proxy.
>  </longdesc>
>  <shortdesc lang="en">OpenSIPS resource agent</shortdesc>
>
>  <actions>
>  <action name="start" timeout="30" />
>  <action name="stop" timeout="30" />
>  <action name="status" depth="0" timeout="30" interval="10"
> start-delay="30" />
>  <action name="monitor" depth="0" timeout="30" interval="10"
> start-delay="30" />
>  <action name="meta-data" timeout="5" />
>  <action name="validate-all" timeout="5" />
>  <action name="notify" timeout="5" />
>  <action name="promote" timeout="5" />
>  <action name="demote" timeout="5" />
>  </actions>
> </resource-agent>
> END
> }
> OpenSIPS_Status() {
>
>
>  /root/sipp.svn/sipp 127.0.0.1 -sf
> /root/sipp.svn/files/REGISTER_client.xml -inf
> /root/sipp.svn/files/REGISTER_client.csv -m 1 -l 1 -recv_timeout 5000 >
> /dev/null
>  rc=$?
>  if
>  [ $rc -ne 0 ]
>  then
>    return $OCF_NOT_RUNNING
>  else
>    return $OCF_SUCCESS
>  fi
> }
> OpenSIPS_Monitor() {
>  OpenSIPS_Status
> }
> OpenSIPS_Start() {
>     if
>  OpenSIPS_Status
>     then
>  return $OCF_SUCCESS
>     else
>     /sbin/opensipsctl restart > /dev/null
>
>     rc=$?
>     if
>  [ $rc -ne 0 ]
>            then
>  return $OCF_ERR_PERM
>     else
>  return $OCF_SUCCESS
>     fi
>    fi
> }
> OpenSIPS_Stop() {
>  /sbin/opensipsctl stop > /dev/null
>  return $OCF_SUCCESS
> }
> OpenSIPS_Validate_All() {
>  return $OCF_SUCCESS
> }
>
> case $__OCF_ACTION in
>  meta-data)            meta_data
>                        exit $OCF_SUCCESS
>                        ;;
>  start)                OpenSIPS_Start
>                        ;;
>  stop)                 OpenSIPS_Stop
>                        ;;
>  monitor)              OpenSIPS_Monitor
>                        ;;
>  status)               OpenSIPS_Status
>                        ;;
>  validate-all)         OpenSIPS_Validate_All
>                        ;;
>  notify)               exit $OCF_SUCCESS
>                        ;;
>  promote)              exit $OCF_SUCCESS
>                        ;;
>  demote)               exit $OCF_SUCCESS
>                        ;;
>  usage)                usage
>                        exit $OCF_SUCCESS
>                        ;;
>  *)                    usage
>                        exit $OCF_ERR_ARGS
>                        ;;
> esac
>
>
>
>
>
> Now  the questions :
>
> when I didn't use the monitor operation from the cib file ,
>
> I have NO PROBLEM to START and STOP the OpenSIPS.
>
> But when I add the monitor operation in the cib file , I got the stuck:
>
> Both monitor and start/stop operation are failed to start.
>
> I use the ocf-tester to test the OpenSIPS  it shows everthing is passed
>
> when I start the heartbeat  I got this:
>
> Online: [ opensips1 opensips2 ]
>  Resource Group: IPaddr2_OpenSIPS_group
>     IPaddr2-10.120.89.222      (ocf::heartbeat:IPaddr2):       Started
> opensips2
>     IPaddr2-192.168.56.199     (ocf::heartbeat:IPaddr2):       Started
> opensips2
>     OpenSIPS   (ocf::anders.com:OpenSIPS):     Stopped
> Failed actions:
>    OpenSIPS_monitor_0 (node=opensips1, call=4, rc=-2, status=Timed Out):
> unknown exec error
>    OpenSIPS_start_0 (node=opensips1, call=12, rc=-2, status=Timed Out):
> unknown exec error
>    OpenSIPS_monitor_0 (node=opensips2, call=4, rc=-2, status=Timed Out):
> unknown exec error
>    OpenSIPS_start_0 (node=opensips2, call=12, rc=-2, status=Timed Out):
> unknown exec error
> I can't find the reason why it was like this ,please help me .  thanks a
> lot!

It has to be something to do with the script or daemon.
We're trying to perform start and monitor actions but they're not
completing in time.

Is there anything in the sips log to indicate what its doing at the
time or why the client might not be returning?
Are the action timeouts too short perhaps?
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to