Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Clustered Postfix servers with shared storage possible?

1,130 views
Skip to first unread message

Frank Thommen

unread,
Nov 6, 2003, 10:58:52 AM11/6/03
to
Dear postfix-users,

to enhance efficiency and availability of our (single) mailserver which
currently serves as SMTP, IMAP and POP-Server with web frontends, we
plan to cluster it with a second machine and attach it to a SAN on the
back end and with a load balancer on the front end:

+-------+
+--| SMTP1 |--+
+-----+ +----------+ | +-------+ | +--------------+
| SAN |--| NFS Head |--+ +--| LoadBalancer |--INET
+-----+ +----------+ | +-------+ | +--------------+
+--| SMTP2 |--+
+-------+

Fabio Corazzas thread on load balancing
(http://marc.theaimsgroup.com/?l=postfix-users&m=105851330623979&w=2)
gave me some ideas, but still I don't understand several things:

* can several Postfix servers share the same disk
space, more exactly: The same queue directories?

* will there be any problems with duplicate message-IDs etc.
if we do so?

* will all Postfix instances from all servers manage all
queue files or does every instance "know" it's files and
work with them only (e.g. when doing a flush or requeue)?

* if every server knows its own queue files, does that mean,
that if one of the server dies, its queue files will stay
untouched/unsent until the server starts working again? And
if the server has to be freshly reinstalled, how can we
tell him which are "his" files?


I'm grateful for any hint or references to already existing
documentation covering that topic.

Kind regards

frank

----------
Frank Thommen, IT Support Group, D-INFK, ETH Zurich, Switzerland
E-Mail: fthommen at inf.ethz.ch; Tel: +41-1-63 27208 (Mon-Thu)
Web: http://www.isg.inf.ethz.ch
----------

Ralf Hildebrandt

unread,
Nov 6, 2003, 11:04:05 AM11/6/03
to
* Frank Thommen <ftho...@inf.ethz.ch>:

>
> +-------+
> +--| SMTP1 |--+
> +-----+ +----------+ | +-------+ | +--------------+
> | SAN |--| NFS Head |--+ +--| LoadBalancer |--INET
> +-----+ +----------+ | +-------+ | +--------------+
> +--| SMTP2 |--+
> +-------+
>
> Fabio Corazzas thread on load balancing
> (http://marc.theaimsgroup.com/?l=postfix-users&m=105851330623979&w=2)
> gave me some ideas, but still I don't understand several things:
>
> * can several Postfix servers share the same disk
> space, more exactly: The same queue directories?

No, and it's documented.

--
Ralf Hildebrandt Ralf.Hil...@charite.de
my current spamtrap spam...@charite.de
http://www.arschkrebs.de/postfix/ Tel. +49 (0)30-450 570-155
I Pledge Allegiance
To the Flag
That Appears on my Desktop Startup Screen.
And to the Monopoly
For Which it Stands;
One Operating System
Over All,
Inescapable,
With Freedom and Privacy for none.

Keith Matthews

unread,
Nov 6, 2003, 11:08:30 AM11/6/03
to
On Thu, 06 Nov 2003 16:58:37 +0100
Frank Thommen <ftho...@inf.ethz.ch> wrote:

> Dear postfix-users,
>
> to enhance efficiency and availability of our (single) mailserver
> which currently serves as SMTP, IMAP and POP-Server with web
> frontends, we plan to cluster it with a second machine and attach it
> to a SAN on the back end and with a load balancer on the front end:
>

Better to look at moving the POP3/IMAP server to another machine and
using NFS. As long as you use maildir you should not have any major
problems. Depends on what POP/IAMP server you use of course.

Wietse Venema

unread,
Nov 6, 2003, 11:22:27 AM11/6/03
to
Frank Thommen:

> * can several Postfix servers share the same disk
> space, more exactly: The same queue directories?

Each Postfix instance must have its own mail queue.

> * will there be any problems with duplicate message-IDs etc.
> if we do so?

Each Postfix instance must have its own mail queue.

> * will all Postfix instances from all servers manage all
> queue files or does every instance "know" it's files and
> work with them only (e.g. when doing a flush or requeue)?

Each Postfix instance must have its own mail queue.

> * if every server knows its own queue files, does that mean,
> that if one of the server dies, its queue files will stay
> untouched/unsent until the server starts working again? And
> if the server has to be freshly reinstalled, how can we
> tell him which are "his" files?

Just boot up another Postfix instance, configured to take
over the mail queue from the broken Postfix instance.

Wietse

Frank Thommen

unread,
Nov 6, 2003, 11:23:46 AM11/6/03
to
> > * can several Postfix servers share the same disk
> > space, more exactly: The same queue directories?
>
> No, and it's documented.

Hmmm...browse..browse...OK. I've now found a relevant comment in the
FAQ (but not in the main documentation).

We will probably try with separate queue directories and try to merge
them in case of the shutdown of one machine.

Ralf Hildebrandt

unread,
Nov 6, 2003, 11:26:32 AM11/6/03
to
* Frank Thommen <ftho...@inf.ethz.ch>:

> > > * can several Postfix servers share the same disk
> > > space, more exactly: The same queue directories?
> >
> > No, and it's documented.
>
> Hmmm...browse..browse...OK. I've now found a relevant comment in the
> FAQ (but not in the main documentation).

Master.cf:

# DO NOT SHARE THE POSTFIX QUEUE BETWEEN MULTIPLE POSTFIX INSTANCES.

A printer consists of three main parts: the case, the jammed paper tray
and the blinking red light

Wietse Venema

unread,
Nov 6, 2003, 11:35:40 AM11/6/03
to
Frank Thommen:

> > > * can several Postfix servers share the same disk
> > > space, more exactly: The same queue directories?
> >
> > No, and it's documented.
>
> Hmmm...browse..browse...OK. I've now found a relevant comment in the
> FAQ (but not in the main documentation).
>
> We will probably try with separate queue directories and try to merge
> them in case of the shutdown of one machine.

That should be safe, provided that:

1 - The receiving Postfix instance is stopped.

2 - The queue files stay within the same file system. Postfix queue
files are named after their inode number to avoid file name
collisions.

If you merge Postfix queue files from one file system into a
queue on a different file system, then mail will be lost.

It really is safer to just start up another Postfix instance
that takes over the queue from the broken Postfix instance.

In the future, the queue will be different and you most likely will
not be able to merge one queue with another one. This is also why
most Postfix queue details are not documented: they are going to
change and therefore nothing outside Postfix should depend on them.

Wietse

Chen Shaopeng

unread,
Nov 6, 2003, 8:43:52 PM11/6/03
to
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigA626CB90C759628D4B4D54E1
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Just a quick question, what needs to change in Postfix to
make it clusterable? I'm starting to look at the v2 source
code, just for the fun of it.

thanks

csp

--------------enigA626CB90C759628D4B4D54E1
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQE/qvhpbEMvPqQdkRgRAr6zAKCzxUDpH9OqYkd2nrAVyu9kOt944QCeMZyb
g/RG4T7vKyNXA4STbO/i6XA=
=WzoP
-----END PGP SIGNATURE-----

--------------enigA626CB90C759628D4B4D54E1--

Wietse Venema

unread,
Nov 7, 2003, 8:42:07 AM11/7/03
to
Scott Every:
> what would you recommend for the case where one mailserver is just not
> enough to handle the volume of incoming mail?

Multiple MX hosts.

Wietse

> On Nov 6, 2003, at 9:28 PM, Wietse Venema wrote:
>
> > Chen Shaopeng:
> > -- Start of PGP signed section.


> >> Just a quick question, what needs to change in Postfix to
> >> make it clusterable? I'm starting to look at the v2 source
> >> code, just for the fun of it.
> >

> > This would be a major architectural change. Postfix is designed
> > around ONE queue manager. When that principle is violated I make
> > no promise of what will work or what will break. I have no desire
> > to spend the rest of the year figuring out the details.
> >
> > Wietse
>
>
>

pare...@tcd.ie

unread,
Nov 7, 2003, 9:10:49 AM11/7/03
to

For what it's worth, we're running postfix on a 2 node Tru64
cluster for a few years now without problem. Each node, has it's
own process space and share a common clustered filesystem. We use
a common configuration directory /etc/postfix, but each node has
it's own queue directory /var/spool/postfix and var/run etc. These
are handled by context sensitive symbolic links, so each cluster node
points to a different queue directory. Also we use Maildir/ so concurrent
delivery in to the filesystem is OK.

Paul

Wietse Venema

unread,
Nov 7, 2003, 9:37:26 AM11/7/03
to
pare...@tcd.ie:

As long as each Postfix master process has its own queue, there
will be no queue access conflicts. Mail delivery is designed to be
collision safe because it has to deal with mail user agents.

Wietse

Luca Berra

unread,
Nov 8, 2003, 4:14:56 AM11/8/03
to
On Thu, Nov 06, 2003 at 04:58:37PM +0100, Frank Thommen wrote:
>I'm grateful for any hint or references to already existing
>documentation covering that topic.
>

create two instances on each postfix machine
postfixA with queue in /var/spool/postfixA
postfixB with queue in /var/spool/postfixB (listening on a different
port than postfixA)

on machineA start postfixA
on machineB start postfixB

if machineA crashes then start postfixA on machineB and vice versa

the load balancer would deal with the difference in ip/port
since you would configure all four servers on it

L.

--
Luca Berra -- bl...@comedia.it
Communication Media & Services S.r.l.
/"\
\ / ASCII RIBBON CAMPAIGN
X AGAINST HTML MAIL
/ \

0 new messages