Thanks very much for the link.  The percona mysql script does pretty much exactly what I need in regards to master/slave promotion/demotion.  I did run into a couple of issues revolving around virtual IPs and how they should follow the master/slave(s) around.<div>

<br><div>The problem that I&#39;m now running into has to do with the grouping of my vip for writer/reader.  I&#39;m trying to get it so that the vip_writer will stay with the Master sql server and the reader will stay with the Slaves.  I&#39;ll have N slaves and I only care about having 1 virtual IP for the slaves.  I don&#39;t care which slave pacemaker picks to have the vip, it just needs to pick one.  I&#39;ve tried to setup some colocation types to map them together but I get into states where the Master sql server will be sitting with the reader_vip.  I&#39;ve included my cib output and what the crm_mon is reporting my current status to be.  As you can see, the sql master and writer_vip are not lined up.</div>

<div><br></div><div>Basically, I now have a cib that looks like this (crm configure show):</div><div><br></div><div><div>node $id=&quot;0d6be727-1552-4028-ad8a-cf54b2766da0&quot; three \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>attributes IP=&quot;172.17.0.130&quot; standby=&quot;off&quot;</div>

<div>node $id=&quot;7deca2cd-9a64-476c-8ea2-372bca859a4f&quot; four \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>attributes IP=&quot;172.17.0.131&quot; standby=&quot;off&quot;</div><div>node $id=&quot;bb15cdbc-8bec-4f64-83bb-8bbd6d4ca1a7&quot; seven \</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>attributes IP=&quot;172.17.0.134&quot; standby=&quot;off&quot;</div><div>primitive p_sql ocf:percona:MySQL_replication \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>params reader_vip_prefix=&quot;reader_vip_&quot; ms_replication_resource_name=&quot;ms_novaSQL&quot; master_log_file=&quot;mysql-bin.000038&quot; master_log_pos=&quot;106&quot; promoted_coordinates=&quot;::&quot; master_host=&quot;172.17.0.131&quot; \</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>params super_db_user=&quot;root&quot; super_db_password=&quot;nova&quot; \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>params repl_db_user=&quot;novaSlave&quot; repl_db_password=&quot;nova&quot; allowed_sbm=&quot;10&quot; \</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>params state_file=&quot;/var/run/heartbeat/novaSQL.state&quot; recover_file=&quot;/var/run/heartbeat/novaSQL.recovery&quot; \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>params p_replication_resource_name=&quot;p_sql&quot; \</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>params heartbeat_table=&quot;ocf.heartbeat&quot; \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>op monitor interval=&quot;10s&quot; role=&quot;Master&quot; \</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>op monitor interval=&quot;10s&quot; role=&quot;Slave&quot;</div><div>primitive reader_vip_1 ocf:heartbeat:IPaddr2 \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>params ip=&quot;172.17.0.97&quot; nic=&quot;eth0&quot; \</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>meta target-role=&quot;Started&quot;</div><div>primitive writer_vip ocf:heartbeat:IPaddr2 \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>params ip=&quot;172.17.0.96&quot; nic=&quot;eth0&quot; \</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>meta target-role=&quot;Started&quot;</div><div>ms ms_novaSQL p_sql \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>meta master-max=&quot;1&quot; master-node-max=&quot;1&quot; clone-max=&quot;3&quot; clone-node-max=&quot;1&quot; target-role=&quot;Master&quot; notify=&quot;false&quot; globally-unique=&quot;false&quot;</div>

<div>colocation reader_vip_coloc_slave inf: ms_novaSQL:Slave reader_vip_1</div><div>colocation writer_vip_coloc_master inf: ms_novaSQL:Master writer_vip</div><div>order order_writer_vip_after_master inf: ms_novaSQL:promote writer_vip:start</div>

<div>property $id=&quot;cib-bootstrap-options&quot; \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>dc-version=&quot;1.0.9-unknown&quot; \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>cluster-infrastructure=&quot;Heartbeat&quot; \</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>stonith-enabled=&quot;false&quot; \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>no-quorum-policy=&quot;ignore&quot; \</div><div>

<span class="Apple-tab-span" style="white-space:pre">        </span>last-lrm-refresh=&quot;1313615481&quot;</div><div><br></div><div>Along with the output from crm_mon.  You can see that the Master sql server has the reader_vip and the slave has the writer_vip (which should be reversed).</div>

<div><br></div><div><div>Node four (7deca2cd-9a64-476c-8ea2-372bca859a4f): online</div><div>        p_sql:1 (ocf::percona:MySQL_replication) Master</div><div>        reader_vip_1    (ocf::heartbeat:IPaddr2) Started</div>
<div>
Node three (0d6be727-1552-4028-ad8a-cf54b2766da0): online</div><div>        p_sql:0 (ocf::percona:MySQL_replication) Slave</div><div>        writer_vip      (ocf::heartbeat:IPaddr2) Started</div><div>Node seven (bb15cdbc-8bec-4f64-83bb-8bbd6d4ca1a7): online</div>

<div>        p_sql:2 (ocf::percona:MySQL_replication) Slave</div></div><div><br></div><div><br></div><div>As always, any ideas/suggestions are appreciated.</div><div><br></div><div>-Mike.</div><div><br></div><br><div class="gmail_quote">

On Mon, Aug 15, 2011 at 1:04 PM, Viacheslav Biriukov <span dir="ltr">&lt;<a href="mailto:v.v.biriukov@gmail.com">v.v.biriukov@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hello.<div>Check it out <a href="https://code.launchpad.net/percona-prm" target="_blank">https://code.launchpad.net/percona-prm</a>. </div><div>And presentation: <a href="http://www.percona.com/files/presentations/percona-live/nyc-2011/PerconaLiveNYC2011-MySQL-High-Availability-with-Pacemaker.pdf" target="_blank">http://www.percona.com/files/presentations/percona-live/nyc-2011/PerconaLiveNYC2011-MySQL-High-Availability-with-Pacemaker.pdf</a><br>


<div><div><div></div><div class="h5"><br><div class="gmail_quote">2011/8/15 Michael Szilagyi <span dir="ltr">&lt;<a href="mailto:mszilagyi@gmail.com" target="_blank">mszilagyi@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


I&#39;m already using the mysql RA file from <a href="https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/mysql" target="_blank">https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/mysql</a> (which also seems to have replication support in it).<div>




<br></div><div>Basically what seems to be happening is that pacemaker detects that the master has dropped and promotes a slave up to master.  However, it is not properly reconfiguring the slaves with a CHANGE MASTER TO.  I can see some lines in the ocf file that relate to changing master but it isn&#39;t setting it up properly.  If I login to the slave and issue a CHANGE MASTER TO ... / START SLAVE then replication will start up normally again.</div>




<div><br></div><div>Since I can see that the script does allow the master host to get set when going through set/unset_master I&#39;m hoping it&#39;s just something I&#39;m missing and not a limitation of using Pacemaker to manage the sql replication cluster.<br>




<br></div><div>Hopefully someone can point me at what I am missing.</div><div><br></div><div>-Mike.</div><div><div></div><div><div><br><div class="gmail_quote">On Mon, Aug 15, 2011 at 1:56 AM, Dan Frincu <span dir="ltr">&lt;<a href="mailto:df.cluster@gmail.com" target="_blank">df.cluster@gmail.com</a>&gt;</span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div><br>
On Sat, Aug 13, 2011 at 2:53 AM, Michael Szilagyi &lt;<a href="mailto:mszilagyi@gmail.com" target="_blank">mszilagyi@gmail.com</a>&gt; wrote:<br>
&gt; I&#39;m new to Pacemaker and trying to understand exactly what it can and can&#39;t<br>
&gt; do.<br>
&gt; I currently have a small, mysql master/slave cluster setup that is getting<br>
&gt; monitored within Heartbeat/Pacemaker:  What I&#39;d like to be able to do (and<br>
&gt; am hoping Pacemaker will do) is to have 1 node designated as Master and in<br>
&gt; the event of a failure, automatically promote a slave to master and realign<br>
&gt; all of the existing slaves to be slaves of the newly promoted master.<br>
&gt;  Currently what seems to be happening, however, is heartbeat correctly sees<br>
&gt; that a node goes down and pacemaker promotes it up to master but the<br>
&gt; replication is not adjusted so that it is now feeding everyone else.  It<br>
&gt; seems like this should be possible to do from within Pacemaker but I feel<br>
&gt; like I&#39;m missing a part of the puzzle.  Any suggestions would be<br>
&gt; appreciated.<br>
<br>
</div>You could try the mysql RA =&gt; from<br>
<a href="https://github.com/fghaas/resource-agents/blob/master/heartbeat/mysql" target="_blank">https://github.com/fghaas/resource-agents/blob/master/heartbeat/mysql</a><br>
Last I heard, it had replication support.<br>
<br>
HTH.<br>
<div><div></div><div><br>
&gt;<br>
&gt; Here&#39;s an output of my crm configure show:<br>
&gt; node $id=&quot;7deca2cd-9a64-476c-8ea2-372bca859a4f&quot; four \<br>
&gt; attributes 172.17.0.130-log-file-p_sql=&quot;mysql-bin.000013&quot;<br>
&gt; 172.17.0.130-log-pos-p_sql=&quot;632&quot;<br>
&gt; node $id=&quot;9b355ab7-8c81-485c-8dcd-1facedde5d03&quot; three \<br>
&gt; attributes 172.17.0.131-log-file-p_sql=&quot;mysql-bin.000020&quot;<br>
&gt; 172.17.0.131-log-pos-p_sql=&quot;106&quot;<br>
&gt; primitive p_sql ocf:heartbeat:mysql \<br>
&gt; params config=&quot;/etc/mysql/my.cnf&quot; binary=&quot;/usr/bin/mysqld_safe&quot;<br>
&gt; datadir=&quot;/var/lib/mysql&quot; \<br>
&gt; params pid=&quot;/var/lib/mysql/novaSQL.pid&quot; socket=&quot;/var/run/mysqld/mysqld.sock&quot;<br>
&gt; \<br>
&gt; params max_slave_lag=&quot;120&quot; \<br>
&gt; params replication_user=&quot;novaSlave&quot; replication_passwd=&quot;nova&quot; \<br>
&gt; params additional_parameters=&quot;--skip-external-locking<br>
&gt; --relay-log=novaSQL-relay-bin --relay-log-index=relay-bin.index<br>
&gt; --relay-log-info-file=<a href="http://relay-bin.info" target="_blank">relay-bin.info</a>&quot; \<br>
&gt; op start interval=&quot;0&quot; timeout=&quot;120&quot; \<br>
&gt; op stop interval=&quot;0&quot; timeout=&quot;120&quot; \<br>
&gt; op promote interval=&quot;0&quot; timeout=&quot;120&quot; \<br>
&gt; op demote interval=&quot;0&quot; timeout=&quot;120&quot; \<br>
&gt; op monitor interval=&quot;10&quot; role=&quot;Master&quot; timeout=&quot;30&quot; \<br>
&gt; op monitor interval=&quot;30&quot; role=&quot;Slave&quot; timeout=&quot;30&quot;<br>
&gt; primitive p_sqlIP ocf:heartbeat:IPaddr2 \<br>
&gt; params ip=&quot;172.17.0.96&quot; \<br>
&gt; op monitor interval=&quot;10s&quot;<br>
&gt; ms ms_sql p_sql \<br>
&gt; meta target-role=&quot;Started&quot; is-managed=&quot;true&quot;<br>
&gt; location l_sqlMaster p_sqlIP 10: three<br>
&gt; location l_sqlSlave1 p_sqlIP 5: four<br>
&gt; property $id=&quot;cib-bootstrap-options&quot; \<br>
&gt; dc-version=&quot;1.0.9-unknown&quot; \<br>
&gt; cluster-infrastructure=&quot;Heartbeat&quot; \<br>
&gt; stonith-enabled=&quot;false&quot; \<br>
&gt; no-quorum-policy=&quot;ignore&quot; \<br>
&gt; last-lrm-refresh=&quot;1313187103&quot;<br>
&gt;<br>
&gt; Thanks!<br>
&gt; -Mike.<br>
</div></div>&gt; _______________________________________________<br>
&gt; Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org" target="_blank">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: <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:<br>
&gt; <a href="http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
--<br>
Dan Frincu<br>
CCNA, RHCE<br>
<br>
_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org" target="_blank">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://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
</blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Pacemaker mailing list: <a href="mailto:Pacemaker@oss.clusterlabs.org" target="_blank">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://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br></div></div><font color="#888888">Viacheslav Biriukov<br>BR<br><div><a href="http://biriukov.com" target="_blank">http://biriukov.com</a></div><br>
</font></div></div>
<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://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker" target="_blank">http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker</a><br>
<br></blockquote></div><br></div></div>