We just finished migrating using 12 spools ext4 RAID5 for much less users (6000) with quotas up to 3Gb.<br>It tooks a few days on line just rename mailboxes to another spool.<br>my script looks like this. Just take care no to abort it in the middle of a rename. It would be better to add a handler for SIGUP/SIGTERM to exit properly.<br>
New spool are sp0, sp1 etc.. I check if it's an old spool then rename mailboxes.<br><br>Hope this helps<br><br>Dom<br><br>#!/usr/bin/perl<br><br>use Cyrus::IMAP::Admin;<br>my $DEBUG=0;<br>my $quota=3072000; # 3 000 Mo selon horde<br>
<br>my %Hspools=(<br> 'a' => 'sp0',<br> 'b' => 'sp1',<br> 'c' => 'sp2',<br> 'd' => 'sp3',<br> 'e' => 'sp4',<br> 'f' => 'sp5',<br>
'g' => 'sp6',<br> 'h' => 'sp0',<br> 'i' => 'sp11',<br> 'j' => 'sp3',<br> 'k' => 'sp5',<br> 'l' => 'sp7',<br>
'm' => 'sp8',<br> 'n' => 'sp5',<br> 'o' => 'sp4',<br> 'p' => 'sp9',<br> 'q' => 'sp11',<br> 'r' => 'sp10',<br>
's' => 'sp4',<br> 't' => 'sp10',<br> 'u' => 'sp11',<br> 'v' => 'sp9',<br> 'w' => 'sp11',<br> 'x' => 'sp11',<br>
'y' => 'sp11',<br> 'z' => 'sp11',<br>);<br><br><br>### Connect IMAP<br>my $client = Cyrus::IMAP::Admin->new('127.0.0.1');<br>$client->authenticate( -user => 'cyrus', -password => 'xxxxxxx',-mechanism => "LOGIN") or die $client->error;<br>
<br>@res=`/usr/cyrus/bin/ctl_mboxlist -d /var/lib/imap/mailboxes.db`;<br>open (LOG,'>>/root/movebal.txt');<br>$i=0;<br>foreach (@res){<br> if (/^user\.(\S+)\s+\d+\s+(\S+)\s+/){<br> $user=$1;<br> $spool=$2;<br>
next if $user=~/\./;<br> next if $spool=~/^sp\d+/;<br> if (IsUserOnline($user)){<br> print "$user en ligne\n";<br> next;<br> }<br> $i++;<br> $lettre=substr($user,0,1);<br>
$client->setacl("user/$user", 'cyrus' => 'all');<br> $client->setacl("user/$user/*", 'cyrus' => 'all');<br> $client->rename("user/$user","user/$user",$Hspools{$lettre});<br>
$now=localtime;<br> printf LOG "$now $user $spool $lettre $Hspools{$lettre}\n";<br> if (defined($client->error)){<br> printf LOG "Pb pour déplacer la bal $uid $Hspools{$lettre}: ",$client->error,"\n";<br>
}<br> $client->setquota("user/$user",'STORAGE' => $quota);<br> }<br>}<br>close LOG;<br><br>sub IsUserOnline{<br> my ($user)=@_;<br> @ret=`grep "$user\tuser.$user" /var/lib/imap/proc/*`;<br>
foreach (@ret){<br> return 1 if /$user/;<br> }<br>}<br><br><br><br><div class="gmail_quote">2010/6/16 Nestor A Diaz <span dir="ltr"><<a href="mailto:nestor@tiendalinux.com">nestor@tiendalinux.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello Cyrus People.<br>
<br>
I have been always a proud user of the cyrus email system, currently my<br>
larger cyrus installation is about 70K users, which have been working<br>
fine, however i need to make some adjustems to improve the resposiviness<br>
of the mailstore.<br>
<br>
At the begining i use only a default mailstore, on a ext3 formatted<br>
filesystem over a raid 10 / LVM, it works fine, however when it reaches<br>
the 32768 directories, (a limitation of ext3) i have to create another<br>
partition, and then another one, so i have currently 3 partitions in total.<br>
<br>
Having defined some criteria in order to group every user into a<br>
partition i will like some recomendations, taking in mind the current<br>
cyrus server tools which i currently don't know what are their current<br>
capabilities, my plan is to forget using cyrus partitions, and instead<br>
using LVM partitions and the propper links to the physical partitions<br>
from the logical one.<br>
<br>
So i currently have:<br>
<br>
partition-default : 30K users<br>
partition-alt1: 20K users<br>
partition-alt2 : 20K users.<br>
<br>
and then i will like to have just one partition:<br>
<br>
partition-default ext4 formatted with links to physical partitions based<br>
on the first letter [a-z] of the user.<br>
<br>
I think LVM is a great advantage, and in some way aliviate the need for<br>
cyrus partitions, i it will lead me deal with the grow of a partition<br>
and data administration so easy without too much downtime.<br>
<br>
So, it means that accordingly to this stragegy which seems to be the<br>
most simple for me, what would be the best technical path to accomplish<br>
a good migration ? allowusermoves: yes option and renamemailbox is<br>
enoguth to do this task ? what if i want to do this online ? can i ? how<br>
? is there any script that will help me do that ?<br>
<br>
Any suggestions or migration histories are welcome !<br>
<br>
What about murder / perdition ? they make any sense in this configuration ?<br>
<br>
Keep this good work !<br>
<br>
Slds.<br>
<br>
--<br>
Nestor A. Diaz<br>
Ingeniero de Sistemas<br>
Tel. +57 1-485-3020 x 211<br>
Cel. +57 316-227-3593<br>
Tel. SIP: <a href="mailto:sip%3A211@tiendalinux.com">sip:211@tiendalinux.com</a><br>
Email/MSN: <a href="mailto:nestor@tiendalinux.com">nestor@tiendalinux.com</a><br>
<a href="http://www.tiendalinux.com/" target="_blank">http://www.tiendalinux.com/</a><br>
Bogota, Colombia<br>
<br>
----<br>
Cyrus Home Page: <a href="http://cyrusimap.web.cmu.edu/" target="_blank">http://cyrusimap.web.cmu.edu/</a><br>
Cyrus Wiki/FAQ: <a href="http://cyrusimap.web.cmu.edu/twiki" target="_blank">http://cyrusimap.web.cmu.edu/twiki</a><br>
List Archives/Info: <a href="http://asg.web.cmu.edu/cyrus/mailing-list.html" target="_blank">http://asg.web.cmu.edu/cyrus/mailing-list.html</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Dominique LALOT<br>Ingénieur Systèmes et Réseaux<br><a href="http://annuaire.univmed.fr/showuser.php?uid=lalot">http://annuaire.univmed.fr/showuser.php?uid=lalot</a><br>