I’m trying to have an idea of heartbeat [[URL]http://www.linux-ha.org/Heartbeat[/URL] ].
Specifically I’m thinking of using it for managing a master-master replication (active-passive) for handing failover.
I want to know how does it recover / switch passive master to active one.
From description here [[URL]http://www.linux-ha.org/GettingStarted[/URL] ] I can sense it’s changing IP or something.
What manual process we must follow to failover passive to active master?
Stop writes on active server.
FLUSH TABLES WITH READ LOCK.
Kill all client connections.
SHOW MASTER STATUS on active server
note the binary log coordinates.
Make sure Passive Master is in sync with Active Master.
Suppose your servers are 10.0.0.1 and 10.0.0.2. Then Heartbeat adds another ip (eg 10.0.0.3) to the master. When the master goes down, the slave gets this ip. So you always connect to 10.0.0.3.
Master-Master with Heartbeat is a pretty common pattern. We’ve been using it in production for a while with success.
The way I learned it is to install heartbeat from my Linux distro package management system (in my case Debian Stable). Then I set-up a test cluster of two machines and played with it and kept a journal of my own experiments. In heartbeat, use the CRM if you can and find the hb_gui program to manage the cluster. Become conversant with the command line tool and CRM shell too (if available). The linux-ha.org website is in a state of flux at the moment as the project name and scope is changing to “Pacemaker” ([URL=“http://ClusterLabs”]http://clusterlabs.org/wiki/Main_Page[/URL]). For heartbeat 2.1.x consult: http://clusterlabs.org/mediawiki/images/7/7d/Configuration_E xplained_0.6.pdf
The heartbeat developers hang out in #linux-ha on FreeNode IRC, you can ask more advice there. They will tell you to pick a distro where you’re NOT using v2.1.x but I’ve found it works.