It was in Linux Journal, search on PERL and heartbeat.
Each node has a daemon (written in PERL in this instance) running that listens for a heartbeat from the master. Heartbeat is sent to each node sequentially, some discrete interval between each. Any node that doesn't get a heartbeat for X intervals issues its own heartbeat. Any heartbeat heard is assumed to be the master.
So the first node is the master. If it drops out, the second node is the first one to notice and sends out a new heartbeat to all other nodes. I'm probably mis-remembering some of the details but that was the basics of it.