Not logged in
Log in now
Create an account
Subscribe to LWN
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
Little things that matter in language design
Posted Nov 19, 2010 20:39 UTC (Fri) by DG (subscriber, #16978)
Posted Nov 21, 2010 0:47 UTC (Sun) by butlerm (subscriber, #13312)
Posted Nov 21, 2010 10:41 UTC (Sun) by dlang (✭ supporter ✭, #313)
however the server doesn't keep the WAL log around forever, so I would expect that if you get so far behind that the master no longer has a copy of things you have to do a backup.
note that this is speculation, I'm not an expert here
Posted Nov 21, 2010 18:39 UTC (Sun) by ewan (subscriber, #5533)
Posted Nov 22, 2010 0:31 UTC (Mon) by Richard_J_Neill (subscriber, #23093)
DRBD has 3 protocols for synchronisation. The middle one (B) is good enough for us: even if the primary server is completely obliterated, our data still survives, unless the secondary suffers a simultaneous UPS failure.
We could do auto-switchover, but in this case, we'd rather have an actual failure and manual change. If the warehouse stops for 5 minutes, it's inconvenient, but the risk of a switchover happening automatically and possible split-brain is worse. Also, perfect failover can sometimes lead to nobody noticing...and then you think your system has redundancy when it no longer does. (I had this happen once with a RAID5 system: one disk failed, and we didn't notice; since that experience, I tend to prefer systems that fail noisily.)
In terms of switchover, there are 2 parts: DRBD and postgres.
1. DRBD can operate with either system as master; if the link goes down and then comes back up, it will resynchronise quite quickly. Likewise, switching master and slave is fast. What you NEVER EVER want is "split brain" - where both halves of the system think they are primary, and they diverge, without it being obvious which one can be discarded.
2. We just switch postgres by mounting and unmounting /var/lib/pgsql on the drbd device. So only one server has the postgresql process running.
It's simply a case of:
drbdadm primary r0
service postgresql start
and the converse.
Posted Nov 22, 2010 6:58 UTC (Mon) by jjs (guest, #10315)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds