From experience (we use these sorts of things on large-scale database platforms), this is a pest to get working, and a downright PITA to get bulletproof. It takes a lot of testing (which a lot of people tend to gloss over) and a *really* good understanding to make reliable. We use commercially built stuff, with extra hardware (dedicated net cards to gen a heartbeat between servers) and it
still happens that the failover software is a lot less reliable than the databases it's supposed to protect
Is this for a business? Or just your house? Or do you have a business that runs from your house? If it isn't just messing around, if there's money on the line, spend the bucks and get a supported system. Otherwise, if you have the time and the inclination, good on ya - maybe you'll come up with something saleable.