On Tuesday, September 06, 2011 11:06:08 PM, Anthony Acquanita wrote: ... > What I like about drdb is the option to go from master to slave, > promote slave to master, setup new slave lather rinse repeat. ...
You need to be careful how you set this up. DRBD replication works well (although I've never tested using it with a DB) -- the problem is in how you handle the HA failover scenarios. DRBD doesn't do the failover -- that's done by 'heartbeat'. Heartbeat on the slave checks to make sure the master is up, and wants to take over if it finds it's unresponsive. This can be done by having one of the real machines take over an IP alias (i.e. eth0:1) which is the "public" IP that service is provided from (you'll see why in the next paragraph). The problem is this also happens when the switch the machines are connected with is down, leading do a "split brain" problem where both machines think that they're "master". That can be ugly to recover from, and you need to know how to deal with that. To try to avoid this, another thing I've seen done is to have a second ethernet card on the machines connected via a direct crossover cable, and setting a routing metric for the two machines to be able to get to each other on the non-aliased IPs if the switch is down. Unfortunately in the setup I was inovled in, another admin not working on the project saw the cable connected between two machines rather than to a switch, and removed the cable thinking that it shouldn't have been there. This wasn't noticed until a power failure took out the switch but not the two servers running DRBD, which led to both being "master" and thus the "split brain" problem again. As far as I recall, DRBD replication can be set up with two machines "live" without having to bring either one of them down. And IIRC it's possible to manually switch the "master" and "slave" machines without heartbeat -- and that's what I'd recommend you do until you've worked out exactly how you want to set up your heartbeat HA failover methodology. BTW the DRBD kernel module was merged into the vanilla Linux kernel with version 2.6.33. Prior to that it was an external module that needed to be compiled. '/sbin/modinfo drbd' should tell you whether the module is available. -- Chris -- Chris Knadle [email protected] _______________________________________________ Mid-Hudson Valley Linux Users Group http://mhvlug.org http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug Upcoming Meetings (6pm - 8pm) MHVLS Auditorium Sep 7 - DIY 3D Printing and the Makerbot Thing-o-Matic Oct 5 - Distributed Authentication Systems Nov 2 - Nov 2011
