[Pacemaker] Master/Master Setup

Michael Marrotte marrotte at gmail.com
Sat Oct 22 19:57:31 UTC 2011


On Sat, Oct 22, 2011 at 3:34 PM, Raoul Bhatia [IPAX] <r.bhatia at ipax.at>wrote:

> hi!
>
>
> On 22.10.2011 20:33, Michael Marrotte wrote:
>
>> primitive p_mysql ocf:heartbeat:mysql \
>>     params binary="/usr/sbin/mysqld" config="/etc/mysql/my.cnf"
>> replication_user="slaveuser" replication_passwd="slavepw"
>> test_passwd="root" pid="/var/run/mysqld/mysqld.**pid"
>> socket="/var/run/mysqld/**mysqld.sock" \
>>     params additional_parameters="--skip-**slave-start" \
>>     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="30" timeout="30" OCF_CHECK_LEVEL="1"
>> ms ms_mysql p_mysql \
>>     meta notify="true" master-max="2" clone-max="2" target-role="Started"
>> property $id="cib-bootstrap-options" \
>>     dc-version="1.0.8-**042548a451fce8400660f6031f4da6**f0223dd5dd" \
>>     cluster-infrastructure="**Heartbeat" \
>>     stonith-enabled="false" \
>>     no-quorum-policy="ignore" \
>>     last-lrm-refresh="1319301867"
>>
>
> master-max should be set to 1 if you're using a master-slave mysql
> setup.
>

Yes.  I usually have it at 1, but was trying different settings here.


>
> you can leave most replication related configuration out of your
> mysql config files. except for the server-id i think.


OK.  I'll try striping that stuff out of my.cnf and see how it goes.

What about in the DB?  Should  CHANGE MASTER TO MASTER_HOST= be set?
If I set it to empty, then I can get Pacemaker to show my nodes ina
master/slave configuration, but when I write to the master, changes do not
get replicated to the slave.  If I don't use Pacemaker and start the DB
manually, replication works great when I have  CHANGE MASTER TO MASTER_HOST=
set properly, i.e. pointing at the other node, log file and position.  When
that's working, I shut down MySQL manually and then cleanup the resources
and try to start with Pacemaker, but get the errors I've included here.


>
>  When I start ms_sql, I'm getting the following:
>>
>> Failed actions:
>>     p_mysql:0_start_0 (node=vsaas-test-sql-1, call=73, rc=1,
>> status=complete): unknown error
>>     p_mysql:1_start_0 (node=vsaas-test-sql-2, call=63, rc=1,
>> status=complete): unknown error
>>
>
> do all of the above files/paths exist?
>

Yes. They do.  I did have a problem early where I had permission problems,
but worked that out.


> my configuration looks this:
>
> primitive wdb-mysql ocf:heartbeat:mysql \
>        op monitor interval="30" timeout="30" \
>        op monitor interval="300" timeout="30" OCF_CHECK_LEVEL="10" \
>        op monitor interval="301" role="Master" timeout="30"
> OCF_CHECK_LEVEL="10" \
>        op monitor interval="31" role="Slave" timeout="30"
> OCF_CHECK_LEVEL="10" \
>        op monitor interval="15" role="Slave" timeout="30" \
>        op monitor interval="10" role="Master" timeout="30" \
>
>        op start interval="0" timeout="120" \
>        op stop interval="0" timeout="120" \
>        params config="/etc/mysql/my.cnf" datadir="/data/db/mysql/data/"
> socket="/var/run/mysqld/**mysqld.sock" binary="/usr/sbin/mysqld"
> additional_parameters="--**basedir=/usr --skip-external-locking
> --log-bin=/data/db/mysql/log/**mysql-bin.log --relay-log=mysqld-relay-bin
> " pid="/var/run/mysqld/mysqld.**pid" test_table="nagiostest.test_**table"
> test_user="nagios" test_passwd="xxxx" replication_user="ruser"
> replication_passwd="rpass"
>
> which version of the mysql ra/which resource agent release do you use?
>

I'm on Ubuntu 10.10 and it had an older version of the mysql agent that
didn't include replication.  So, I grabber the latest off of github and
patched up the shellfunc path like you suggested, previously.  That got rid
of of bunch of errors and looked promising about 8 hours ago :)


>
> and please provide the log files! otherwise, its hard to correctly
> diagnose the problem.
>

Please find logs attached and let me know if you'd like to look at some
others.

Thanks for all the help.


>
> cheers,
> raoul
>
> ______________________________**_________________
> Pacemaker mailing list: Pacemaker at oss.clusterlabs.org
> http://oss.clusterlabs.org/**mailman/listinfo/pacemaker<http://oss.clusterlabs.org/mailman/listinfo/pacemaker>
>
> Project Home: http://www.clusterlabs.org
> Getting started: http://www.clusterlabs.org/**doc/Cluster_from_Scratch.pdf<http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf>
> Bugs: http://developerbugs.linux-**foundation.org/enter_bug.cgi?**
> product=Pacemaker<http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20111022/726c82df/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ha-debug.vts-1
Type: application/octet-stream
Size: 135611 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20111022/726c82df/attachment-0016.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ha-debug.vts-2
Type: application/octet-stream
Size: 38927 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20111022/726c82df/attachment-0017.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ha-log.vts-1
Type: application/octet-stream
Size: 41529 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20111022/726c82df/attachment-0018.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ha-log.vts-2
Type: application/octet-stream
Size: 38927 bytes
Desc: not available
URL: <https://lists.clusterlabs.org/pipermail/pacemaker/attachments/20111022/726c82df/attachment-0019.obj>


More information about the Pacemaker mailing list