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"><<a href="mailto:dvossel@redhat.com" target="_blank">dvossel@redhat.com</a>></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>
> From: "Cal Heldenbrand" <<a href="mailto:cal@fbsdata.com">cal@fbsdata.com</a>><br>
> To: "The Pacemaker cluster resource manager" <<a href="mailto:pacemaker@oss.clusterlabs.org">pacemaker@oss.clusterlabs.org</a>><br>
> Sent: Friday, November 9, 2012 4:29:05 PM<br>
> Subject: [Pacemaker] Custom event script during master/slave failover?<br>
><br>
><br>
> Hi everyone,<br>
><br>
> I'm playing around with the possibility of using Pacemaker in a Redis<br>
> master/slave cluster. The difficult part of this, is that Redis will<br>
> not automatically flip itself from read-only slave mode into master<br>
> mode. A client needs to connect to the slave server and run this<br>
> 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>
><br>
> If I set up a master/slave primitive, is it possible to fire an event<br>
> script during a failover event that would allow me to do this?<br>
><br>
> After the stonith event fires and the broken master reboots,<br>
> I would<br>
> write in something special in the Redis init.d script to detect if<br>
> 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>
><br>
> 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>
> Thank you,<br>
><br>
> --Cal<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:<br>
> <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>
><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>