Chinaunix首页 | 论坛 | 博客
  • 博客访问: 430048
  • 博文数量: 53
  • 博客积分: 2265
  • 博客等级: 大尉
  • 技术积分: 574
  • 用 户 组: 普通用户
  • 注册时间: 2007-08-15 16:50












分类: BSD

2014-05-06 18:23:07

在cyrus-imapd的partition (paritition-default: /var/spool/cyrus)满情况下,新增的分区可采用此参数来增容,举例如:
partition-1: /data/spool/cyrus1

新建的Mailbox, 可(在FB下):
cm user/johndoe 1

Cyrus Part VIII: Using Mailstore Partitioning to Extend Storage Capacities. PDF Print E-mail
Written by Sam Caldwell   
Thursday, 25 November 2010 23:02

Problem Statement:

There exists a Cyrus mail server whose mail store has approached the maximum size of the disk partition where it is located. Develop a long term strategy for scaling the system in size while minimizing any long-term performance penalties.


There are two solutions to this problem. The first solution would be to stop the mail server, move the mail store to a larger storage device and start the mail server. This solution is NOT acceptable, as it would involve a considerable amount of downtime during the mail spool migration process. For example, given a 2TB mailspool which must be transferred over a 1GBps link, users could expect at least 1 hour of downtime. Additionally, as the system scales using this procedure, size will eventually lead to a performance impact. Multiple mail operations will bottleneck at a single mailspool and device.

The second solution is more acceptable. Minimal downtime is required. What downtime is required is limited to the individual users migrated (as explained) rather than to the entire system. This means that downtime can be scheduled around individual user work times. Cyrus IMAP servers allow mail to be stored in one or more partition. Persons familiar with Microsoft Exchange should know that in large organizations, Exchange performance and scalability can be best served by dividing the enterprise into multiple mail stores. Likewise, as defined below, we overcome a space limitation on one device by adding a new Cyrus mail spool partition.

Cyrus mail spools can be subdivided into paritions. Thus, where one physical storage system approaches capacity, another storage system may be added as a new Cyrus mail partition. The original partition remains in-place and operational during and after this operation. Further as the mail environment scales, separate physical storage systems overcome any performance bottleneck.

Assume the current mail server has only a single (default) partition. this partition will be specified in /etc/imapd.conf:

paritition-default: /var/spool/cyrus
defaultpartition: default

When a new mailbox is created with cyradm it is created in this default partition (unless another partition is specified).


  1. Add new storage device (e.g. hard disks, JBOD, SAN, NAS).
  2. Create a disk partition on new storage device.
  3. Format the new partition with EXT3/4, XFS, REISER or other planned file system.
  4. Add the mounting instructions for the new partition to /etc/fstab.
  5. Manually mount the new paritition.
  6. Assuming the original mailstore was mounted as /var/spool/cyrus, we mount the new storage as /var/spool/cyrus1.
  7. Edit /etc/imapd.conf as follows:
    		partition-default: /var/spool/cyrus
    		partition-1: /var/spool/cyrus1
    		defaultpartition: default
  8. Restart Cyrus by typing "/etc/init.d/imapd restart."

Once the imapd daemon is restarted, the configuration file will be reloaded. Afterward, any new mailboxes can be created by specifying the new partition:

	cm user.johndoe 1

In this example, we create user.johndoe on partition 1. If we do not specify the new partition, the mailbox for johndoe will be created on the default partition.

Moving Mailboxes Across Partitions

Creating new mailbox partitions will extend the overall size of the mail system. However, the size of the initial mail store partition will remain fixed. As users in the old partition continue to take in new emails, it may become necessary to move existing mailboxes to the new partition, as follows:

  1. Connect to the mail server by typing "cyradm --user cyrus localhost" and press [enter]
  2. Rename the mailbox to the new paritition:
    		renamemailbox user.johndoe user.johndoe partition-1

NOTE: When renaming mailboxes, the user should be logged out. This can be verified by checking /var/imap/proc to see if the user's userid appears in the list.


阅读(701) | 评论(0) | 转发(0) |