Hello,
Assuming we have two (low traffic) servers (on different data centers) replicated using dsync, what is the best way to automatically direct users to the main server when it is up and to the redundant one when the main server is down?
Using DNS? I've seen that DNS-based failover has generally issues (for example: http://serverfault.com/questions/60553/why-is-dns-failover-not-recommended, which is informative although it refers to web servers).
What is the suggested approach? HAProxy? Heartbeat/Pacemaker?
Any advice will be appreciated.
Thanks and regards, Nick
On 19.4.2013, at 9.59, Nikolaos Milas <nmilas@noa.gr> wrote:
Assuming we have two (low traffic) servers (on different data centers) replicated using dsync, what is the best way to automatically direct users to the main server when it is up and to the redundant one when the main server is down?
Using DNS? I've seen that DNS-based failover has generally issues (for example: http://serverfault.com/questions/60553/why-is-dns-failover-not-recommended, which is informative although it refers to web servers).
What is the suggested approach? HAProxy? Heartbeat/Pacemaker?
Well, there are two failure reasons:
a) Dovecot server fails. For that, you could use any kind of a proxy that redirects traffic to the other server (even Dovecot proxy on another server).
b) Network connection to the whole data center dies, or the whole data center loses power or otherwise dies. There's really no other choice to failover that than DNS, unless you manage to route the same IP address to two different data centers and just update the route.
I'd be more worried about b), since you can already fix a) pretty quickly with VMs. Or a) could also be switched to become a Dovecot proxy on demand if there's a bigger problem that can't be immediately fixed.
On 19.4.2013, at 10.43, Timo Sirainen <tss@iki.fi> wrote:
On 19.4.2013, at 9.59, Nikolaos Milas <nmilas@noa.gr> wrote:
Assuming we have two (low traffic) servers (on different data centers) replicated using dsync, what is the best way to automatically direct users to the main server when it is up and to the redundant one when the main server is down?
Using DNS? I've seen that DNS-based failover has generally issues (for example: http://serverfault.com/questions/60553/why-is-dns-failover-not-recommended, which is informative although it refers to web servers).
BTW. I'm kind of hoping that if dsync replication becomes more commonly used with people commonly setting up two A records for the IMAP server, the IMAP clients would evolve to support this by trying out all the listed IPs. Web browsers already do this nowadays (and that's why I think your URL is a bit out of date).
On 4/19/13 2:49 AM, Timo Sirainen wrote:
On 19.4.2013, at 10.43, Timo Sirainen <tss@iki.fi> wrote:
On 19.4.2013, at 9.59, Nikolaos Milas <nmilas@noa.gr> wrote:
Assuming we have two (low traffic) servers (on different data centers) replicated using dsync, what is the best way to automatically direct users to the main server when it is up and to the redundant one when the main server is down?
Using DNS? I've seen that DNS-based failover has generally issues (for example: http://serverfault.com/questions/60553/why-is-dns-failover-not-recommended, which is informative although it refers to web servers). BTW. I'm kind of hoping that if dsync replication becomes more commonly used with people commonly setting up two A records for the IMAP server, the IMAP clients would evolve to support this by trying out all the listed IPs. Web browsers already do this nowadays (and that's why I think your URL is a bit out of date).
If DNS were the preferred method for load balancing IMAP/POP3 (or others) I would recommend the clients begin supporting SRV records as they were specifically designed to handle this kind of scenario.
speaking of failover, recall about two years ago when I and (IIRC two others, forget who, dont have copy of messages anymore) asked about mysql failover (where it only talked to the second host when the first failed to respond - like postfix does) you mentioned it would go on your "to do list" for future release, this was back in 1.2, now we are at 2.2, how is this option proceeding?
On Fri, 2013-04-19 at 10:43 +0300, Timo Sirainen wrote:
On 19.4.2013, at 9.59, Nikolaos Milas <nmilas@noa.gr> wrote:
Assuming we have two (low traffic) servers (on different data centers) replicated using dsync, what is the best way to automatically direct users to the main server when it is up and to the redundant one when the main server is down?
Using DNS? I've seen that DNS-based failover has generally issues (for example: http://serverfault.com/questions/60553/why-is-dns-failover-not-recommended, which is informative although it refers to web servers).
What is the suggested approach? HAProxy? Heartbeat/Pacemaker?
Well, there are two failure reasons:
a) Dovecot server fails. For that, you could use any kind of a proxy that redirects traffic to the other server (even Dovecot proxy on another server).
b) Network connection to the whole data center dies, or the whole data center loses power or otherwise dies. There's really no other choice to failover that than DNS, unless you manage to route the same IP address to two different data centers and just update the route.
I'd be more worried about b), since you can already fix a) pretty quickly with VMs. Or a) could also be switched to become a Dovecot proxy on demand if there's a bigger problem that can't be immediately fixed.
Am 19.04.2013 08:59, schrieb Nikolaos Milas:
Hello,
Assuming we have two (low traffic) servers (on different data centers) replicated using dsync, what is the best way to automatically direct users to the main server when it is up and to the redundant one when the main server is down?
Using DNS? I've seen that DNS-based failover has generally issues (for example: http://serverfault.com/questions/60553/why-is-dns-failover-not-recommended, which is informative although it refers to web servers).
What is the suggested approach? HAProxy? Heartbeat/Pacemaker?
i run keepalived as loadbalancer/failover but pacemaker etc should work fine too
Any advice will be appreciated.
Thanks and regards, Nick
Best Regards MfG Robert Schetterer
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Joerg Heidrich
participants (5)
-
list@airstreamcomm.net
-
Nikolaos Milas
-
Noel Butler
-
Robert Schetterer
-
Timo Sirainen