<p dir="ltr"><br>
Le 10 avr. 2014 15:44, &quot;Christian Ciach&quot; &lt;<a href="mailto:dereineda@gmail.com">dereineda@gmail.com</a>&gt; a écrit :<br>
&gt;<br>
&gt; I don&#39;t really like the idea to periodically poll &quot;crm_node -q&quot; for the current quorum state. No matter how frequently the monitor-function gets called, there will always be a small time frame where both nodes will be in the master state at the same time. <br>

&gt;<br>
&gt; Is there a way to get a notification to the OCF-agent whenever the quorum state changes?</p>
<p dir="ltr">You should probably look for something like this in the ocfshellfunction.sh file.</p>
<p dir="ltr">But also take a look at the page below, it has a lot of multi state dedicated variables that are most definitely useful in your case.</p>
<p dir="ltr"><a href="http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/_multi_state_proper_interpretation_of_notification_environment_variables.html">http://clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/_multi_state_proper_interpretation_of_notification_environment_variables.html</a></p>

<p dir="ltr">&gt;<br>
&gt;<br>
&gt; 2014-04-08 10:14 GMT+02:00 Christian Ciach &lt;<a href="mailto:dereineda@gmail.com">dereineda@gmail.com</a>&gt;:<br>
&gt;<br>
&gt;&gt; Interesting idea! I can confirm that this works. So, I need to monitor the output of &quot;crm_node -q&quot; to check if the current partition has quorum. If the partition doesn&#39;t have quorum, I need to set the location constraint according to your example. If the partition gets quorum again, I need to remove the constraint.<br>

&gt;&gt;<br>
&gt;&gt; This seems almost a bit hacky, but it should work okay. Thank you! It almost a shame that pacemaker doesn&#39;t have &quot;demote&quot; as a &quot;no-quorum-policy&quot;, but supports &quot;demote&quot; as a &quot;loss-policy&quot; for tickets.<br>

&gt;&gt;<br>
&gt;&gt; Yesterday I had another idea: Maybe I won&#39;t use a multistate resource agent but a primitive instead. This way, I will start the resource outside of pacemaker and let the start-action of the OCF-agent set the resource to master and the stop-action sets it to slave. Then I will just use &quot;no-quorum-policy=stop&quot;. The downside of this is that I cannot distinguish between a stopped resource and a resource in a slave state using crm_mon.<br>

&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
&gt; <a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
&gt;<br>
&gt; Project Home: <a href="http://www.clusterlabs.org">http://www.clusterlabs.org</a><br>
&gt; Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
&gt; Bugs: <a href="http://bugs.clusterlabs.org">http://bugs.clusterlabs.org</a><br>
&gt;<br>
</p>