I'm trying to configure a 2-node openais / pacemaker cluster, and finding information / tutorials very difficult to come by.
My goal is to set up 2 MySQL servers in a master-slave replication scenerio, where I can read from both servers, but only write to the "master" server.
As such, I have the replication and manual failover working by swapping secondary IP addresses, and reconfiguring the new slave with the "read-only" option in my.cnf. I would now like to automate this with pacemaker. Basically I want the master IP to always be on the server that I can write to, and the slave IP to always be on the other one. I would like failover to occur when mysql on the master fails to respond.
Here is the configuration I have so far. Is there somebody that could check my work (which I'm sure is incomplete), and give me some pointers about what I'm doing wrong? (note: the mysql-master script is a custom script under /etc/init.d that sets/clears the read-only option, and restarts mysql)
primitive virtual_master_ip ocf:heartbeat:IPaddr2 \ params ip=192.168.250.xxx.xxx \ op monitor interval=10s primitive virtual_slave_ip ocf:heartbeat:IPaddr2 \ params ip=192.168.xxx.yyy primitive mysql_service ocf:heartbeat:mysql params binary="/usr/bin/mysqld_safe" config="/etc/mysql/my.cnf" \ op minitor interval="60s" timeout="30s" \ meta target-role="Started" primitive mysql_master_role lsb:mysql-master group mysql virtual_master_ip mysql_master virtual_slave_ip colocation ms_ip inf: virtual_master_ip virtual_slave_ip score="-INFINITY"