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

I have a mail domain and two servers (machines) with Centos 6.4 and public IP addresses. Postfix mail server and Dovecot IMAP/POP3 Server are installed on both.

How would I set them up redundantly so that they would be in sync permanently so I could send and receive using any one of them and there would be no visible outage if one of the servers were down? Should the Inbox and all messages be stored on both servers for redundancy?

share|improve this question

You would need to cluster your Dovecot service. This is commonly done using a highly-available shared storage (which can be a distributed file system like GlusterFS / RedHat GFS2), see the Dovecot Wiki for details.

It also seems possible to use the dsync mailbox replication engine for keeping your instances in sync without the need for shared storage. A design draft dealing with the details of such an implementation has been published on the Dovecot blog. Make sure to use the latest 2.2 release of DoveCot if you take this route.

The SMTP service for incoming mail would not need clustering as such - the protocol is designed for fault-tolerant implementations without a single point of failure. You simply can set up two independent Postfix instances delivering to your Dovecot cluster and provide MX records pointing to each of them.

To have users connect seamlessly to your SMTP and IMAP services during an outage, consider providing a virtual IP address using a cluster resource manager service similar to Pacemaker which would be set up to direct users to the functioning server immediately and any outages would go truly unnoticed. If you cannot spare another IPv4 address for the use as a virtual IP, just setting up your both servers' IP addresses as A records for a single label in the DNS would do the job too, but clients might notice inconsistent behavior or prolonged connection times while trying to connect to an unavailable or malfunctioning server.

share|improve this answer
1  
In my experience, GlusterFS is just too slow to use for mail, especially IMAP and more especially webmail using IMAP. Since its random, small file performance is a disaster compared to local storage, this results in most webmail apps being extremely slow. The Gluster team likes to point out that random small file performance is just as poor with other distributed filesystems, and that does make sense. – Ernie Jun 22 at 18:03

Your Answer

 
discard

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.