<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> <HEAD> <meta http-equiv="Content-type" content="text/html;charset=UTF-8"> <TITLE>Cyrus replication </title> </head> <body> <h1>Cyrus replication</h1> <b><i>Note that Cyrus replication is still relatively young in the grand scheme of things, and if you choose to deploy you are doing so at your own risk. The core of the replication code has been used successfully in production at <a href="http://www-uxsup.csx.cam.ac.uk/~dpc22/cyrus/replication.html">Cambridge University</a> since the summer of 2003, but it has been rewritten extensively as part of the integration into the mainstream Cyrus codebase. The replication code as integrated into Cyrus 2.3 has been running in production at Fastmail.fm and Columbia.edu since early 2006 and will be put into production at CMU in winter 2007. </i></b> <p><i>The Cyrus team owes a debt of gratitude to the kind folks at Cambridge, Columbia, and Fastmail for their considerable effort in helping to identify and correct the bugs the in Cyrus 2.3 replication code.</i> <h3>Introduction & Assumptions</h3> <p>The Cyrus replication engine is designed to replicate the mailstore on standalone Cyrus servers or "backend" servers in a Cyrus Murder to provide a high-availability environment. It is <b>NOT</b> intended to replicate "frontend" servers or the "mupdate master" in a Cyrus Murder. <i>Note that load balancing is not possible with the current replication code, but it is intended to be supported in the future.</i></p> <p>This document assumes that you have successfully been able to setup atleast one Cyrus IMAP server. This server will become your first "master" server. It also assumes that you are familliar with the administration and day to day operations of the Cyrus IMAP server and the SASL authentication library. If you feel uncomfortable with this, please refer to the rest of the documentation first.</p> <h2>Installation</h2> You will need to build Cyrus IMAPd with the <tt>--enable-replication</tt> configure option. This builds the replication client/server applications and utilities. <h3>Requirements</h3> <ul> <li>Atleast one standalone or "backend" Cyrus IMAP server.</li> <li>Atleast one machine that will become the first "replica" server.</li> </ul> <h3>Configuring the "replica" server</h3> The "replica" server is a <i>standalone</i> server which listens for and processes synchronization messages from a "master" server. The "replica" server needs to be configured to accept these synchonization messages. The "replica" server <b>MUST NOT</b> be configured to be part of a Murder (it should only be configured into the Murder at the point at which it replaces a failed backend "master").<p> <ol> <li>Configure a standalone server as described in the rest of the documentation. <li>Add the following line to the "<tt>/etc/services</tt>" file. <pre> csync 2005/tcp </pre> <p>Note that the port number is arbitrary as long as its not being used by any other services on your network. <p><li> Add a line similar to the following in the SERVICES section of cyrus.conf:<p> <pre> syncserver cmd="/usr/cyrus/bin/sync_server" listen="csync" </pre> <p><li>Start/restart <tt>"/usr/cyrus/bin/master"</tt>. </ol> <h3>Configuring the "master" server</h3> The "master" server is the standalone or "backend" server which is actively serving mailboxes to clients. This server needs to be configured to synchronize its mailstore with a "replica" server.<p> <ol> <li>Add the following line to the "<tt>/etc/services</tt>" file. <pre> csync 2005/tcp </pre> <p>Note that the port number MUST be the same as that used on the "replica" server. <li> Specify the hostname of the "replica" server and how to authenticate to it using the following imap.conf options: <ul> <li><tt>sync_host</tt> <li><tt>sync_authname</tt> <li><tt>sync_realm</tt> <li><tt>sync_password</tt> </ul> <p>Note that <tt>sync_authname</tt> MUST be an admin on the "replica" server. Also note that <tt>sync_realm</tt> and <tt>sync_password</tt> may not be necessary depending on the SASL mechanism used for authentication. </ol> <h4>Compression</h4> If you are running replication over a remote link, then the tradeoff between bandwidth and CPU usage will tilt strongly in favour of enabling compression to save bandwidth at a slight increase in CPU cost. You can set the 'sync_compress' imapd.conf value, or pass the '-z' flag to sync_client. <ol> <li><tt>sync_compress: 1</tt> </ol> <h4>"Rolling" replication</h4> "Rolling" replication means that the "master" server continuously synchonizes itself with the replica. To configure "rolling" replication, perform the following: <ol> <li>Enable the <tt>sync_log</tt> option in imapd.conf. This allows the <tt>imapd</tt>, <tt>pop3d</tt>, <tt>nntpd</tt>, and <tt>lmtpd</tt> services to log synchonization actions which will be periodically serviced by <tt>sync_client</tt>. <li>Optionally, adjust the <tt>sync_repeat_interval</tt> in imapd.conf. <li> Add a line similar to the following in the STARTUP section of cyrus.conf: <pre> syncclient cmd="/usr/cyrus/bin/sync_client -r" </pre> <li>Start/restart <tt>"/usr/cyrus/bin/master"</tt>. </ol> <h2>Administration</h2> <h3>Manual replication</h3> To manually synchonize any part of the mailstore, simply run <tt>sync_client(8)</tt> with the appropriate command line options. Note that you CAN manually synchonize even if "rolling" replication has been configured. <p>You can also run <tt>cyr_synclog(8)</tt> instead, which will insert the record into the rolling replication log. <h3>Failover</h3> <P><HR> last modified: $Date: 2010/01/06 17:01:29 $ </BODY></HTML>