Thanks David!  <br><br>--Cal<br><br><div class="gmail_quote">On Fri, Nov 9, 2012 at 4:52 PM, David Vossel <span dir="ltr">&lt;<a href="mailto:dvossel@redhat.com" target="_blank">dvossel@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<br>
----- Original Message -----<br>
&gt; From: &quot;Cal Heldenbrand&quot; &lt;<a href="mailto:cal@fbsdata.com">cal@fbsdata.com</a>&gt;<br>
&gt; To: &quot;The Pacemaker cluster resource manager&quot; &lt;<a href="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</a>&gt;<br>
&gt; Sent: Friday, November 9, 2012 4:29:05 PM<br>
&gt; Subject: [Pacemaker] Custom event script during master/slave failover?<br>
&gt;<br>
&gt;<br>
&gt; Hi everyone,<br>
&gt;<br>
&gt; I&#39;m playing around with the possibility of using Pacemaker in a Redis<br>
&gt; master/slave cluster. The difficult part of this, is that Redis will<br>
&gt; not automatically flip itself from read-only slave mode into master<br>
&gt; mode. A client needs to connect to the slave server and run this<br>
&gt; SLAVEOF NO ONE command to turn it into a master.<br>
<br>
</div>The resource agent should be able to do this. Pacemaker will tell the resource agent to promote/demote a resource.  Your Redis agent can then go off and do whatever logic is necessary to actually transition the process a master/slave process.<br>


<div class="im"><br>
&gt;<br>
&gt; If I set up a master/slave primitive, is it possible to fire an event<br>
&gt; script during a failover event that would allow me to do this?<br>
&gt;<br>
&gt; After the stonith event fires and the broken master reboots,<br>
&gt; I would<br>
&gt; write in something special in the Redis init.d script to detect if<br>
&gt; my peer is already a master, and start up in slave mode.<br>
<br>
</div>If you are using Pacemaker, it should be controlling what node has the master resource and what node has the slave resource.  Take a look at what OCF scripts are and how pacemaker uses them.<br>
<div class="im"><br>
&gt;<br>
&gt; Has anyone else worked up a cluster config with Redis?<br>
<br>
</div>Using google, found some work someone did on a redis resource agent.<br>
<a href="https://github.com/martinwalter/resource-agents/blob/master/heartbeat/redis" target="_blank">https://github.com/martinwalter/resource-agents/blob/master/heartbeat/redis</a><br>
<br>
-- Vossel<br>
&gt; Thank you,<br>
&gt;<br>
&gt; --Cal<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" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
&gt;<br>
&gt; Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
&gt; Getting started:<br>
&gt; <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
&gt; Bugs: <a href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><br>
&gt;<br>
<br>
_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org">Pacemaker@oss.clusterlabs.org</a><br>
<a href="http://oss.clusterlabs.org/mailman/listinfo/pacemaker" target="_blank">http://oss.clusterlabs.org/mailman/listinfo/pacemaker</a><br>
<br>
Project Home: <a href="http://www.clusterlabs.org" target="_blank">http://www.clusterlabs.org</a><br>
Getting started: <a href="http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf" target="_blank">http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf</a><br>
Bugs: <a href="http://bugs.clusterlabs.org" target="_blank">http://bugs.clusterlabs.org</a><br>
</blockquote></div><br>