<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">Is this the correct way to do it?</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px; RIGHT: auto"><SPAN style="RIGHT: auto">primitive p_asterisk ocf:heartbeat:asterisk \<BR>&nbsp;params user="root" group="root" maxfiles="65536" \<BR>&nbsp;op start interval="0" timeout="30s" \<BR>&nbsp;op monitor interval="10s" timeout="30s" \<BR>&nbsp;op stop interval="0" timeout="30s" migration-threshold="1"</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">I tried stopping the asterisk service using service asterisk stop. I repeated that for at least 4 times but the service keeps restarting on the same node<VAR id=yui-ie-cursor></VAR></div></SPAN>
<div><BR></div>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV dir=ltr><FONT size=2 face=Arial>----- Forwarded Message -----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> emmanuel segura &lt;emi2fast@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Tommy Cooper &lt;tomcooper83@yahoo.com&gt;; The Pacemaker cluster resource manager &lt;pacemaker@oss.clusterlabs.org&gt; <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, March 4, 2013 11:05 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [Pacemaker] Cluster resources failing to move<BR></FONT></DIV><BR>
<META content=off http-equiv=x-dns-prefetch-control>
<DIV style="RIGHT: auto" id=yiv1634721597>From Suse Docs<BR><BR>
<H3 class=yiv1634721597title>7.4.2.&nbsp;Cleaning Up Resources<SPAN class=yiv1634721597permalink><A title="Copy Permalink" href="http://doc.opensuse.org/products/draft/SLE-HA/SLE-ha-guide_sd_draft/cha.ha.manual_config.html#sec.ha.manual_config.cleanup" rel=nofollow target=_blank>¶</A></SPAN></H3>
<div style="RIGHT: auto">A resource will be automatically restarted if it fails, but each failure raises the resource's failcount. If a <CODE style="RIGHT: auto" class=yiv1634721597literal>migration-threshold</CODE> has been set for that resource, the node will no longer be allowed to run the resource as soon as the number of failures has reached the migration threshold. </div><BR><BR>
<DIV style="RIGHT: auto" class=yiv1634721597gmail_quote>2013/3/4 Tommy Cooper <SPAN dir=ltr>&lt;<A href="mailto:tomcooper83@yahoo.com" rel=nofollow target=_blank ymailto="mailto:tomcooper83@yahoo.com">tomcooper83@yahoo.com</A>&gt;</SPAN><BR>
<BLOCKQUOTE style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex; RIGHT: auto" class=yiv1634721597gmail_quote>
<DIV style="RIGHT: auto">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV><SPAN>I have removed the order and colocation statements but I am still getting the same results.&nbsp;Asterisk keeps restarting on the same server, how can I switch to the other server when asterisk fails? I used those statements to make sure that both services are running on the same server and to make sure that the virtual IP is started before asterisk.<VAR></VAR><BR></SPAN></DIV>
<DIV><BR></DIV>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV style="RIGHT: auto" dir=ltr><FONT style="RIGHT: auto" face=Arial>
<DIV style="RIGHT: auto" class=yiv1634721597im>----- Forwarded Message -----<BR><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Jake Smith &lt;<A href="mailto:jsmith@argotec.com" rel=nofollow target=_blank ymailto="mailto:jsmith@argotec.com">jsmith@argotec.com</A>&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Tommy Cooper &lt;<A href="mailto:tomcooper83@yahoo.com" rel=nofollow target=_blank ymailto="mailto:tomcooper83@yahoo.com">tomcooper83@yahoo.com</A>&gt;; The Pacemaker cluster resource manager &lt;<A style="RIGHT: auto" href="mailto:pacemaker@oss.clusterlabs.org" rel=nofollow target=_blank ymailto="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</A>&gt; <BR></DIV>
<DIV class=yiv1634721597im><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Monday, March 4, 2013 10:00 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [Pacemaker] Fw: Cluster resources failing to move<BR></DIV></FONT></DIV>
<DIV class=yiv1634721597im><BR><BR>----- Original Message -----<BR>&gt; From: "Tommy Cooper" &lt;<A href="mailto:tomcooper83@yahoo.com" rel=nofollow target=_blank ymailto="mailto:tomcooper83@yahoo.com">tomcooper83@yahoo.com</A>&gt;<BR>&gt; To: <A href="mailto:pacemaker@oss.clusterlabs.org" rel=nofollow target=_blank ymailto="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</A><BR></DIV>
<DIV class=yiv1634721597im>&gt; Sent: Monday, March 4, 2013 3:51:03 PM<BR></DIV>
<DIV class=yiv1634721597im>&gt; Subject: [Pacemaker] Fw:&nbsp; Cluster resources failing to move<BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; Thank you for your prompt reply. I actually wanted to create an<BR>&gt; active/passive cluster, so if either the network or Asterisk fails<BR>&gt; these services could be migrated to the other server. As I already<BR>&gt; stated earlier, the current config notifies me if asterisk is down<BR>&gt; but does not start asterisk on the other server.<BR><BR></DIV>
<DIV class=yiv1634721597im>Did asterisk restart on the same server? &lt;- this is what I would expect pacemaker to do.<BR><BR>Removing the colocation (and order) statements didn't have any effect?<BR><BR>&gt; <BR>&gt; <BR></DIV>
<DIV>
<DIV class=yiv1634721597h5>&gt; ----- Forwarded Message -----<BR>&gt; From: Jake Smith &lt;<A href="mailto:jsmith@argotec.com" rel=nofollow target=_blank ymailto="mailto:jsmith@argotec.com">jsmith@argotec.com</A>&gt;<BR>&gt; To: Tommy Cooper &lt;<A href="mailto:tomcooper83@yahoo.com" rel=nofollow target=_blank ymailto="mailto:tomcooper83@yahoo.com">tomcooper83@yahoo.com</A>&gt;; The Pacemaker cluster<BR>&gt; resource manager &lt;<A href="mailto:pacemaker@oss.clusterlabs.org" rel=nofollow target=_blank ymailto="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</A>&gt;<BR>&gt; Sent: Monday, March 4, 2013 9:29 PM<BR>&gt; Subject: Re: [Pacemaker] Cluster resources failing to move<BR>&gt; <BR>&gt; <BR>&gt; ----- Original Message -----<BR>&gt; &gt; From: "Tommy Cooper" &lt; <A href="mailto:tomcooper83@yahoo.com" rel=nofollow target=_blank ymailto="mailto:tomcooper83@yahoo.com">tomcooper83@yahoo.com</A> &gt;<BR>&gt; &gt; To: <A
 href="mailto:pacemaker@oss.clusterlabs.org" rel=nofollow target=_blank ymailto="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</A><BR>&gt; &gt; Sent: Monday, March 4, 2013 2:19:22 PM<BR>&gt; &gt; Subject: [Pacemaker] Cluster resources failing to move<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; Hi,<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; I am trying to configure a 2 node cluster using pac emaker 1.1.7<BR>&gt; &gt; and<BR>&gt; &gt; corosync 1.4.1. I. I want pacemaker to provide the virual IP<BR>&gt; &gt; (192.168.1.115), monitor Asterisk (PBX) and failover to the othe<BR>&gt; &gt; server. If I switch off pacemaker and/or corosync the cluster<BR>&gt; &gt; resources switch to the other node. I have also configured<BR>&gt; &gt; <A href="http://res_corosync.so/" rel=nofollow target=_blank>res_corosync.so</A> module in Asterisk However if i either switch off<BR>&gt; &gt; asterisk using service *service name* stop,
 the following error is<BR>&gt; &gt; shown: Failed actions:<BR>&gt; &gt; p_asterisk_monitor_10000 (node=node1.localdomain, call=10, rc=7,<BR>&gt; &gt; status=complete): not running<BR>&gt; &gt; <BR>&gt; <BR>&gt; What do you want/expect to happen when you stop asterisk that<BR>&gt; doesn't? The monitor showing not running (failed) is expected if<BR>&gt; some outside event stopped the resource.<BR>&gt; <BR>&gt; &gt; Corosync configuration:<BR>&gt; &gt; <BR>&gt; &gt; compatibility: whitetank<BR>&gt; &gt; totem {<BR>&gt; &gt; version: 2<BR>&gt; &gt; secauth: off<BR>&gt; &gt; interface {<BR>&gt; &gt; member {<BR>&gt; &gt; memberaddr: 192.168.1.113<BR>&gt; &gt; }<BR>&gt; &gt; member {<BR>&gt; &gt; memberaddr: 192.168.1.114<BR>&gt; &gt; }<BR>&gt; &gt; ringnumber: 0<BR>&gt; &gt; bindnetaddr: 192.168.1.0<BR>&gt; &gt; mcastport: 5405<BR>&gt; &gt; ttl: 1<BR>&gt; &gt; }<BR>&gt; &gt; transport: udpu<BR>&gt; &gt; }<BR>&gt; &gt; logging {<BR>&gt; &gt; fileline:
 off<BR>&gt; &gt; to_logfile: yes<BR>&gt; &gt; to_syslog: yes<BR>&gt; &gt; debug: on<BR>&gt; &gt; logfile: /var/log/cluster/corosync.log<BR>&gt; &gt; debug: off<BR>&gt; &gt; timestamp: on<BR>&gt; &gt; logger_subsys {<BR>&gt; &gt; subsys: AMF<BR>&gt; &gt; debug: off<BR>&gt; &gt; }<BR>&gt; &gt; }<BR>&gt; &gt; <BR>&gt; &gt; amf {<BR>&gt; &gt; mode: disabled<BR>&gt; &gt; }<BR>&gt; &gt; quorum {<BR>&gt; &gt; provider: corosync_votequorum<BR>&gt; &gt; expected_votes: 3<BR>&gt; &gt; }<BR>&gt; &gt; <BR>&gt; &gt; crm configure status:<BR>&gt; &gt; <BR>&gt; &gt; node node1.localdomain<BR>&gt; &gt; node node2.localdomain<BR>&gt; &gt; primitive failover-ip ocf:heartbeat:IPaddr2 \<BR>&gt; &gt; params ip="192.168.1.115" cidr_netmask="24" nic="eth6" \<BR>&gt; &gt; op start interval="0" timeout="30" \<BR>&gt; &gt; op monitor interval="1s" timeout="30" start-delay="0" \<BR>&gt; &gt; op stop interval="0" timeout="30s" \<BR>&gt; &gt; meta target-role="started"<BR>&gt; &gt;
 primitive p_asterisk ocf:heartbeat:asterisk \<BR>&gt; &gt; params user="root" group="root" maxfiles="65536" \<BR>&gt; &gt; op start interval="0" timeout="30s" \<BR>&gt; &gt; op monitor interval="10s" timeout="30s" \<BR>&gt; &gt; op stop interval="0" timeout="30s"<BR>&gt; &gt; group voip failover-ip p_asterisk<BR>&gt; <BR>&gt; You don't need these colocation and order statements if you have the<BR>&gt; resources grouped - remove them. The group is a syntax shortcut for<BR>&gt; writing order and colocation statements so the above is enforcing an<BR>&gt; order of ip then asterisk and a colocation of asterisk with ip. Also<BR>&gt; the colocation below is backwards and *might* be causing your<BR>&gt; issues.<BR>&gt; <BR>&gt; HTH<BR>&gt; Jake<BR>&gt; <BR>&gt; &gt; colocation asterisk_cluster inf: failover-ip p_asterisk<BR>&gt; &gt; order start_order inf: failover-ip p_asterisk<BR>&gt; &gt; property $id="cib-bootstrap-options" \<BR>&gt; &gt;
 dc-version="1.1.7-6.el6-148fccfd5985c5590cc601123c6c16e966b85d14" \<BR>&gt; &gt; cluster-infrastructure="openais" \<BR>&gt; &gt; expected-quorum-votes="2" \<BR>&gt; &gt; stonith-enabled="false" \<BR>&gt; &gt; no-quorum-policy="ignore"<BR>&gt; &gt; rsc_defaults $id="rsc-options" \<BR>&gt; &gt; resource-stickiness="100"<BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; _______________________________________________<BR>&gt; &gt; Pacemaker mailing list: <A href="mailto:Pacemaker@oss.clusterlabs.org" rel=nofollow target=_blank ymailto="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</A><BR>&gt; &gt; <A href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" rel=nofollow target=_blank>http://oss.clusterlabs.org/mailman/listinfo/pacemaker</A><BR>&gt; &gt; <BR></DIV></DIV>&gt; &gt; Project Home: <A href="http://www.clusterlabs.org/" rel=nofollow target=_blank>http://www.clusterlabs.org/</A><BR>&gt; &gt;
 Getting started:<BR>&gt; &gt; <A href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" rel=nofollow target=_blank>http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</A><BR>&gt; &gt; Bugs: <A href="http://bugs.clusterlabs.org/" rel=nofollow target=_blank>http://bugs.clusterlabs.org/</A>
<DIV class=yiv1634721597im><BR>&gt; &gt; <BR>&gt; <BR>&gt; <BR>&gt; <BR>&gt; _______________________________________________<BR>&gt; Pacemaker mailing list: <A href="mailto:Pacemaker@oss.clusterlabs.org" rel=nofollow target=_blank ymailto="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</A><BR>&gt; <A href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" rel=nofollow target=_blank>http://oss.clusterlabs.org/mailman/listinfo/pacemaker</A><BR>&gt; <BR></DIV>&gt; Project Home: <A href="http://www.clusterlabs.org/" rel=nofollow target=_blank>http://www.clusterlabs.org/</A><BR>&gt; Getting started:<BR>&gt; <A href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" rel=nofollow target=_blank>http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</A><BR>&gt; Bugs: <A href="http://bugs.clusterlabs.org/" rel=nofollow target=_blank>http://bugs.clusterlabs.org/</A><BR>&gt;
 <BR><BR><BR></DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>Pacemaker mailing list: <A href="mailto:Pacemaker@oss.clusterlabs.org" rel=nofollow target=_blank ymailto="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</A><BR><A href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" rel=nofollow target=_blank>http://oss.clusterlabs.org/mailman/listinfo/pacemaker</A><BR><BR>Project Home: <A href="http://www.clusterlabs.org/" rel=nofollow target=_blank>http://www.clusterlabs.org/</A><BR>Getting started: <A href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" rel=nofollow target=_blank>http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</A><BR>Bugs: <A href="http://bugs.clusterlabs.org/" rel=nofollow target=_blank>http://bugs.clusterlabs.org/</A><BR><BR></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- <BR>esta es mi vida e me la vivo hasta que dios quiera </DIV>
<META content=on http-equiv=x-dns-prefetch-control><BR><BR></DIV></DIV></div></body></html>