Re: What are the conditions for the replication to work?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Quoting mildred-ml@xxxxxxxxxx:

Hello,

I'd like first to thank the authors of Cyrus IMAP which is a great software. I'm designing an architecture of mail servers using it and I have questions regarding replication.

I have seen somewhere in the documentation that servers were usually deployed in pairs with replication between them. I suppose then that there is a master and a slave. What is not clear however is how to ensure that the state is kept equal between the two servers.


The recommended way is to use rolling replication. This will create
a log-File {configdirectory}/sync/<channel>/log where different
channels allow to have multiple replicas, backup servers or update
search indexes

The log-File does not contain the changes, but information where
something has changed. The sync_client in rolling replication will
move the file, process it and will repeat. In normal Operation the
file will be processed faster than the changes occure.


In particular, if the master server goes down, and the slave server is used instead, the two servers will become out of sync. The master might have some changes that it did not had time to replicate to the slave, and the slave in between become a temporary master and had new changes as well. How to reconcile this?


There are some changes that cyrus can detect and fix if you replicate form
the temporary master to the old master (e.g. new/deleted Mails)
Other changes cyrus is not able to resolve, and if you do nothing the version
of the temporary will prevail (e.g. subscribed/unsubscribed mailboxes)

There is some development to allow cyrus to resolve these changes.

If you are concerned you can read the sync log to know what might be missing.
For practical purpose I copy the sync-log from the old-master to the temporary
master and run the sync_client with the log. This will ensure that all mails
delivered to the old master will be transfered. And that both systems are in sync
after the temporary master has cathed up with the reolling replication

PS.: before you allow users access to the new master you must enable rolling replication
to log all changes


Can replication be set up from the slave back to the master? What are the risks in such a scenario (what if there are conflicting changes)? Is it possible to setup incremental synchronization in both directions, can the protocol cope with that?

Theoretical you can configure replication on both sides. But as mentioned above for some kinds of replicated data cyrus will be unable to detect which side has the more recent version. So conflicting changes would probably lead to unpredictable,
and inconsistent changes e.g. bothe sides rename a mailbox to different name
(rename mailbox, unsubscribe old mailbox, subscribe new mailbox) if the rename from Server A
and the subscribe from server B survives

If you want to use bothe servers i would recommend to partition your users among multiple servers
and run multiple insances (one master, one replica) on each server.
See https://cyrus.topicbox.com/groups/info/T7a361715be957813-Mf88daa8db4a1841a96dea3e9/cyrus-murder-documentation



--------------------------------------------------------------------------------
Michael Menge                          Tel.: (49) 7071 / 29-70316
Universität Tübingen                   Fax.: (49) 7071 / 29-5912
Zentrum für Datenverarbeitung mail: michael.menge@xxxxxxxxxxxxxxxxxxxx
Wächterstraße 76
72074 Tübingen


------------------------------------------
Cyrus: Info
Permalink: https://cyrus.topicbox.com/groups/info/Tc5837f7dfaad94a9-Mc9010af069a5789a4dbe974d
Delivery options: https://cyrus.topicbox.com/groups/info/subscription




[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux