Cyrus replication and failover best pracistes
Bron Gondwana
brong at fastmail.fm
Mon Aug 9 20:25:58 EDT 2010
On Mon, Aug 09, 2010 at 08:15:36PM +0400, Dmitry Ivanov wrote:
> Hello!
> Folks, looking through maillist history i saw that many of you are
> running cyrus in rolling replication mode. I am interested in
> configuring cyrus replica to use as a standby imap server, where we can
> switch DNS in case of problems with primary backend. While testing on
> playground I got some problems and several questions appeared, may be
> you can help me to solve this.
>
> 1. Is it safe to leave "sync_host:" options in imapd.conf and running
> sync_server (due to record in cyrus.conf) on both master and replica,
> and start only sync_client -r on master server? Or better to have
> different config files for different roles?
Yeah, that's pretty safe. We run sync_server on our masters as well
so that we can move users between machines.
I'm not such a fan of the sync_host config variables - I'd prefer to
pass the information on the sync_client command line. Should go fix
that!
> 2. Is there any way to solve issue when master overwrites messages with
> the same filename on replica (messages that were not synced before
> disaster happened) during syncing back to primary host? "guid_mode:
> sha1" set.
We have a patch at FastMail that does it. There's one again 2.3.16,
or soon it will be the default behaviour with the new sync protocol
(I keep talking about it ...) It's actually up and running at FastMail
now, so I'll be pushing it back to CVS soon, and we'll work on making
a release.
> May be some one can describe method of switching between replicated
> backends in production? For now I want to switch DNS and and than
> start/stop sync_client daemon.
We do have slightly different configurations, so we have to shut down
both ends. In future I plan to have sync_client running at both ends,
so it's master-master, but with DNS only pointing at one end, and some
sort of "barrier" process where we kill off connections before switching.
The barrier is needed if you don't want to be in split-brain recovery
mode ALL the time, because some clients hold IMAP connections open for
days.
Bron.
More information about the Info-cyrus
mailing list