[Dovecot] Best Cluster Storage

Stan Hoeppner stan at hardwarefreak.com
Thu Jan 13 10:16:58 EET 2011


Jonathan Tripathy put forth on 1/13/2011 1:22 AM:

> I wish to create a Postfix/Dovecot active-active cluster (each node will run
> Postfix *and* Dovecot), which will obviously have to use central storage. I'm
> looking for ideas to see what's the best out there. All of this will be running
> on multiple Xen hosts, however I don't think that matters as long as I make sure
> that the cluster nodes are on different physical boxes.

I've never used Xen.  Doesn't it abstract the physical storage layer in the same
manner as VMWare ESX?  If so, everything relating to HA below is pretty much
meaningless except for locking.

> Here are my ideas so far for the central storage:
> 
> 1) NFS Server using DRBD+LinuxHA. Export the same NFS share to each mail server.
> Which this seems easy, how well does Dovecot work with NFS? I've read the wiki
> page, and it doesn't sound promising. But it may be outdated..
> 
> 2) Export block storage using iSCSI from targets which have GFS2 on
> DRBD+LinuxHA. This is tricky to get working well, and it's only a theory.
> 
> 3) GlusterFS. Easy to set up, but apparently very slow to run.
> 
> So what's everybody using? I know that Postfix runs well on NFS (according to
> their docs). I intend to use Maildir

In this Xen setup, I think the best way to accomplish your goals is to create 6
guests:

2 x Linux Postfix
2 x Linux Dovecot
1 x Linux NFS server
1 x Linux Dovecot director

Each of these can be painfully small stripped down Linux instances.  Configure
each Postfix and Dovecot server to access the same NFS export.  Configure
Postfix to use native local delivery to NFS/maildir.  Don't use LDA (deliver).

With Postfix HA is automatic:  you simply setup both servers with the same DNS
MX priority.  DNS automatically takes care of HA for MX mail by design.  If a
remote SMTP client can't reach one MX it'll try the other automatically.  Of
course, you already knew this (or should have).

Configure each Dovecot instance to use the NFS/maildir export.  Disable indexing
unless or until you've confirmed that director is working sufficiently well to
keep each client hitting the same Dovecot server.

Have Xen run Postfix+Dovecot paired on two different hosts and have the NFS
server and director on a third Xeon host.  This ordering will obviously change
if hosts fail and your Xen scripts auto restart the guests on other hosts.

Now, all of the above assumes that since you are running a Xen cluster that you
are using shared fiber channel or iSCSI storage arrays on the back end, and that
each Xen host has a direct (or switched) connection to such storage and thus has
block level access to the LUNs on each SAN array.  If you do not have shared
storage for the cluster, disregard everything above, and pondering why you asked
any of this in the first place.

For any meaningful use of virtualized clusters with Xen, ESX, etc, a
prerequisite is shared storage.  If you don't have it, get it.  The hypervisor
is what gives you fault tolerance.  This requires shared storage.  If you do not
intend to install shared storage, and intend to use things like drbd between
guests to get your storage redundancy, then you really need to simply throw out
your hypervisor, in this case Xen, and do direct bare metal host clustering with
drbd, gfs2, NFS, etc.

-- 
Stan


More information about the dovecot mailing list