[Pacemaker] Question about Pacemaker master/slave and mysql replication

Viacheslav Biriukov v.v.biriukov at gmail.com
Mon Aug 15 21:04:05 CET 2011


Hello.
Check it out https://code.launchpad.net/percona-prm.
And presentation:
http://www.percona.com/files/presentations/percona-live/nyc-2011/PerconaLiveNYC2011-MySQL-High-Availability-with-Pacemaker.pdf

2011/8/15 Michael Szilagyi <mszilagyi at gmail.com>

> I'm already using the mysql RA file from
> https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/mysql(which also seems to have replication support in it).
>
> 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'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.
>
> Since I can see that the script does allow the master host to get set when
> going through set/unset_master I'm hoping it's just something I'm missing
> and not a limitation of using Pacemaker to manage the sql replication
> cluster.
>
> Hopefully someone can point me at what I am missing.
>
> -Mike.
>
> On Mon, Aug 15, 2011 at 1:56 AM, Dan Frincu <df.cluster at gmail.com> wrote:
>
>> Hi,
>>
>> On Sat, Aug 13, 2011 at 2:53 AM, Michael Szilagyi <mszilagyi at gmail.com>
>> wrote:
>> > I'm new to Pacemaker and trying to understand exactly what it can and
>> can't
>> > do.
>> > I currently have a small, mysql master/slave cluster setup that is
>> getting
>> > monitored within Heartbeat/Pacemaker:  What I'd like to be able to do
>> (and
>> > am hoping Pacemaker will do) is to have 1 node designated as Master and
>> in
>> > the event of a failure, automatically promote a slave to master and
>> realign
>> > all of the existing slaves to be slaves of the newly promoted master.
>> >  Currently what seems to be happening, however, is heartbeat correctly
>> sees
>> > that a node goes down and pacemaker promotes it up to master but the
>> > replication is not adjusted so that it is now feeding everyone else.  It
>> > seems like this should be possible to do from within Pacemaker but I
>> feel
>> > like I'm missing a part of the puzzle.  Any suggestions would be
>> > appreciated.
>>
>> You could try the mysql RA => from
>> https://github.com/fghaas/resource-agents/blob/master/heartbeat/mysql
>> Last I heard, it had replication support.
>>
>> HTH.
>>
>> >
>> > Here's an output of my crm configure show:
>> > node $id="7deca2cd-9a64-476c-8ea2-372bca859a4f" four \
>> > attributes 172.17.0.130-log-file-p_sql="mysql-bin.000013"
>> > 172.17.0.130-log-pos-p_sql="632"
>> > node $id="9b355ab7-8c81-485c-8dcd-1facedde5d03" three \
>> > attributes 172.17.0.131-log-file-p_sql="mysql-bin.000020"
>> > 172.17.0.131-log-pos-p_sql="106"
>> > primitive p_sql ocf:heartbeat:mysql \
>> > params config="/etc/mysql/my.cnf" binary="/usr/bin/mysqld_safe"
>> > datadir="/var/lib/mysql" \
>> > params pid="/var/lib/mysql/novaSQL.pid"
>> socket="/var/run/mysqld/mysqld.sock"
>> > \
>> > params max_slave_lag="120" \
>> > params replication_user="novaSlave" replication_passwd="nova" \
>> > params additional_parameters="--skip-external-locking
>> > --relay-log=novaSQL-relay-bin --relay-log-index=relay-bin.index
>> > --relay-log-info-file=relay-bin.info" \
>> > op start interval="0" timeout="120" \
>> > op stop interval="0" timeout="120" \
>> > op promote interval="0" timeout="120" \
>> > op demote interval="0" timeout="120" \
>> > op monitor interval="10" role="Master" timeout="30" \
>> > op monitor interval="30" role="Slave" timeout="30"
>> > primitive p_sqlIP ocf:heartbeat:IPaddr2 \
>> > params ip="172.17.0.96" \
>> > op monitor interval="10s"
>> > ms ms_sql p_sql \
>> > meta target-role="Started" is-managed="true"
>> > location l_sqlMaster p_sqlIP 10: three
>> > location l_sqlSlave1 p_sqlIP 5: four
>> > property $id="cib-bootstrap-options" \
>> > dc-version="1.0.9-unknown" \
>> > cluster-infrastructure="Heartbeat" \
>> > stonith-enabled="false" \
>> > no-quorum-policy="ignore" \
>> > last-lrm-refresh="1313187103"
>> >
>> > Thanks!
>> > -Mike.
>> > _______________________________________________
>> > Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>> > http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>> >
>> > Project Home: http://www.clusterlabs.org
>> > Getting started:
>> http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>> > Bugs:
>> >
>> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>> >
>> >
>>
>>
>>
>> --
>> Dan Frincu
>> CCNA, RHCE
>>
>> _______________________________________________
>> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
>> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>>
>> Project Home: http://www.clusterlabs.org
>> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
>> Bugs:
>> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>>
>
>
> _______________________________________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/mailman/listinfo/pacemaker
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
> Bugs:
> http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker
>
>


-- 
Viacheslav Biriukov
BR
http://biriukov.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://oss.clusterlabs.org/pipermail/pacemaker/attachments/20110815/5c4f8daf/attachment.html>


More information about the Pacemaker mailing list