Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Given two hosts running SMTP and IMAP services, how would you best make them redundant so that one can easily take over if the other goes down?

Keep in mind there are no other servers where network filesystems can be hosted and you must assume any of the two could break.

Rsync would be bound to lose mail, unless it could be triggered by something like fanotify or inotify. And even then I don't even want to think about the disk i/o for that setup.

share|improve this question
up vote 2 down vote accepted

What you are looking for is DRBD to keep the filesystems in sync . This is included in the linux kernel since 2.6.33

share|improve this answer
You probably also want to look into Pacemaker and OpenAIS to handle the failover/migration bits. – Kendall Oct 17 '11 at 18:20
This is perfect, I only need to update using Debian Backport to 2.6.39 kernel because right now Debian Squeeze is 2.6.32. – Stefan M Oct 18 '11 at 9:22

Think twice on implementing this. Having a client (or worse two) simultaneously accessing the same IMAP mailbox on different hosts may break everything. So you would break things in production whereas you just inteded to make sure you get failover in case of emergency.

Test thoroughly all possibilities and options. To make things easier I would use the second one as semi-cold standby. All SMTP and IMAP will be on one server with a distributed filesystem (DRBD) to the other server. In case of emergency you shutdown the first, switch IPs on the other and restart the other. In this case access to the mailbox storage is easier to manage, no concurrency and therefore no inconsistence.

On the other hand you probably want load balancing where you slice your mailboxes. The one half gets delivered on the one server and the other half on the other server. As you replicate your storage you can switch (in an emergency) to the clean machine and run all mailboxes there.

To sum up: The problem is the concurrent access to the storage. Solve that problem and you can have failover/high availability/load balancing.

share|improve this answer
You're actually right, if I wasn't able to update the kernel I would rather have a cold standby and use lsyncd for example. – Stefan M Oct 18 '11 at 9:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.