On 26/01/11 02:37, Bradley Watkins wrote: > Ted Nokonechny <Ted.Nokonechny <at> uregina.ca> writes: > >> >> >> I am interested in setting up MySQL Master/Slave replication using the new >> MySQL RA. I'm using the SLES11-SP1-HA offerings and am running into a lack >> of a concrete example of how to set this up (not using drbd on the >> backend). >> >> If anyone could provide: >> the mysql "my.cnf" replication settings and >> the "crm configure" commands >> to setup the 3-node MySQL replication cluster that is described in the >> linbit webex session: >> >> > http://www.linbit.com/en/training/on-demand-webinars/mysql-replication-with-pacemaker/ >> >> I haven't been able to find a complete example of how to setup and use >> this functionality and I've run into issues with both mysql instances >> running as the MySQL master. >> > > While I don't have the same issue (I get a master and a slave in a two-node > setup), replication does not work. > > I agree that it would be extremely helpful to have a sample my.cnf file and > "crm > configure show" output from a working setup. It would go a long way to > helping > debug the issues we are both having.
I've working setup with two-node mysql replication. I'm using my custom version of mysql RA (part of my changes are commited to git, but not all). Patches (and my current version of script): http://marmarek.w.staszic.waw.pl/patches/ha-mysql-ra/ My configs and some instructions how to setup this: --- primitive DevelDatabase ocf:heartbeat:mysql \ params user="mysql" max_slave_lag="120" config="/etc/mysql/my.cnf" \ params test_table="test.test" test_user="repl" test_passwd="xxx" \ params pid="/var/run/mysqld/mysqld.pid" \ params additional_parameters="--skip-external-locking --skip-slave-start" \ params replication_user="repl" replication_passwd="xxx" \ params binary="/usr/bin/mysqld_safe" socket="/var/run/mysqld/mysqld.sock" state="/var/lib/heartbeat/mysql-repl.state" \ op monitor interval="30s" timeout="30s" OCF_CHECK_LEVEL="10" \ op monitor interval="20s" role="Master" timeout="30s" OCF_CHECK_LEVEL="10" \ op start interval="0" timeout="120s" \ op stop interval="0" timeout="30s" ms DevelReplDatabase DevelDatabase \ meta master-max="1" master-node-max="1" clone-max="2" clone-node-max="1" notify="true" target-role="Master" is-managed="true" location DevelDb-loc-1 DevelReplDatabase 50: node1 location DevelDb-loc-2 DevelReplDatabase 100: node2 --- In my.cnf: --- server-id = 1 # different on each node log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 1 --- To start this, you must setup replication manually for the first time: 0. Put resource in unmanage, start mysqld manually (or by init.d script) on both nodes. 1. on master: mysqldump --master-data --all-databases > dump.sql 2. on slave: load this dump, start slave, verify that all works as expected 3. on slave: show master status 4. on master: change master to ... (yes, on _master_), start slave 5. stop both mysqld 6. put resource in manage. This is required, because this ra agent does not provide any method to discover replication position on another node. Alternative method is to issue "RESET MASTER" on both nodes before starting replication. -- Best Regards, Marek Marczykowski | gg:2873965 | RLU #390519 marmarek at staszic waw pl | xmpp:marmarek at staszic waw pl
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Linux-HA mailing list [email protected] http://lists.linux-ha.org/mailman/listinfo/linux-ha See also: http://linux-ha.org/ReportingProblems
