master-master replication

Michael Menge michael.menge at zdv.uni-tuebingen.de
Thu Sep 13 04:22:12 EDT 2018


Hi,

This setup is NOT SUPPORTED and WILL BREAK if the replication process  
is triggered
from the wrong server (user is active on both servers, user switched  
from one server
to the other while the sync-log file is still processed, after split  
brain) and
some mailboxes have been subscribed, renamed created deleted.....

Also there is the risk of a race condition with subscriptions, if a  
user subscribes
to multiple folders, the first will trigger a sync from A to B, but as  
the folder
is subscribed on B it will trigger a sync from B to A, witch can undo the next
folder subscription.

These are only some cases that came to my mind. There will be more  
cases and it
will be hard to debug. So DON'T DO IT!

What we do is, that we have distributed our users between multiple
instances, and each server is running one instance as master and one other
as replic. In case of failure or maintenance we stop the master instance, and
promote the corresponding replic and configure them so that they will sync
them back. If the old master is up to date we switch them back.

We use cyrus aggregator aka cyrus murder, and AFAIK fastmail also uses  
multiple
instances on one server with nginx frontends

Regards,

    Michael





Quoting Evgeniy Kononov via Info-cyrus <info-cyrus at lists.andrew.cmu.edu>:

> Sorry! Previous message was sent by mistake.
>
> For example, I can configure both servers as follows.
>
> Server A.
> -----------------
> /etc/cyrus.conf
> START {
> ...
> syncclient       cmd="sync_client -r"
> ...
> }
> SERVICES {
> ...
> syncserver       cmd="sync_server" listen="csync"
> ...
> }
>
> /etc/imapd.conf
> ...
> sync_host: SERVER-B
> sync_authname: admin
> sync_password: password
> sync_log: 1
> sync_repeat_interval: 30
> sync_timeout: 600
> sync_shutdown_file: /var/lib/imap/syncstop And the same on server B.
> -----------------
> /etc/cyrus.conf
> START {
> ...
> syncclient       cmd="sync_client -r"
> ...
> }
> SERVICES {
> ...
> syncserver       cmd="sync_server" listen="csync"
> ...
> }
>
> /etc/imapd.conf
> ...
> sync_host: SERVER-A
> sync_authname: admin
> sync_password: password
> sync_log: 1
> sync_repeat_interval: 30
> sync_timeout: 600
> sync_shutdown_file: /var/lib/imap/syncstop
> Both server will be as master and as slave in one time.
>
> Will there be any problems with this configuration?
> Thank you. --
> Evgeniy Kononov



--------------------------------------------------------------------------------
M.Menge                                Tel.: (49) 7071/29-70316
Universität Tübingen                   Fax.: (49) 7071/29-5912
Zentrum für Datenverarbeitung          mail:  
michael.menge at zdv.uni-tuebingen.de
Wächterstraße 76
72074 Tübingen



More information about the Info-cyrus mailing list