1 (edited by maxie_ro 2010-05-05 14:44:02)

Topic: 1 to 1 sync between two iRedMail servers

Hi.

What should I do if I wanted to sync 1 to 1 two iRedMail servers? ZhangHuangbin already pointed out here that syncing accounts is easy, but how about e-mails? Sieve scripts?

Any ideas?

2

Re: 1 to 1 sync between two iRedMail servers

rsync?

or use drbd with gfs

3

Re: 1 to 1 sync between two iRedMail servers

I don't think that would work.

What I have in mind: A backup solution where both servers are fully functional and fully synchronized between themselves, and none of them is actually just a small backup with less functionality.

E.g., 2 iRedMail servers, A and B. Both are identical as domains and user accounts, both have the same priority in the DNS, so both receive mail. Also, some kind of round-robin in the DNS, so users which have accounts on them connect randomly on A and B.

Now, if a mail gets delivered to A, it must be also visible (and physically present) very fast on B too. If a mail gets deleted on B, it should also be deleted on A and so on...

Can rsync do that? Let me raise a problem for example: For a user account, let call it John, the mailboxes on A and B are almost identical, with one difference: there is a mail message M1 only on A. Now, what does this mean? That message M1 just got delivered on server A, and B should get it too with rsync, or that the user connected to B and deleted it from there and A should delete it too?

How about quota? If mails get delivered on A and B, will the user quota get updated correctly?

4

Re: 1 to 1 sync between two iRedMail servers

maxie_ro wrote:

Can rsync do that?

No!
I didn´t found a solution yet, need server2server replication too!!!
I havn´t tested DRDB or glusterFS but it should work.
An another possible solution is NFS (3rd server) but Dovecot has still some bugs [???] and a single NFS server is another point of failure.


mbsouth

5

Re: 1 to 1 sync between two iRedMail servers

You guys are talking about load balance. Someone can start to work on it, public your ideas, progress, questions, ... here so that others can help you move on.

6

Re: 1 to 1 sync between two iRedMail servers

Hi,

for simple solution, i have setup a rsync solution between 2 servers (same configs)  :
one is main , second is slave , i do a sync every 3 minutes (mails are being deleted if deleted on main)

for 2 primary servers (2 way sync) you'll need drbd + gfs (i also used it) but difficult to setup
or iscsi, san,  or files system over ip

or move to dbmail and have all mails in a mysql/postgresql database (but iredmail setup will fail as dbmail will replace dovecot, ---  i did not test)
-

7

Re: 1 to 1 sync between two iRedMail servers

an idea :

setup freenas of openfiler and configure an iscsi target and mount it on /var/vmail

can someone have suffisant hardware to test it?

8

Re: 1 to 1 sync between two iRedMail servers

You guys can lead a sub-project to implement it smile

9 (edited by conheotiensinh1983 2010-05-21 00:36:28)

Re: 1 to 1 sync between two iRedMail servers

Hi ALl

I think we will 2 this option for this problem
1/ if you use SQL as backend .We can use  2 steps for sync 2 iredmail
a/use rsync for this sync mail data(or we can create data server for mail data as SAN,freenac...)
b/use replicate DB(vmail) for mail box,alias... as prefer:http://conheotiensinh.blogspot.com/2009/09/cluster-linux-mail-server.html
2/if you use LDAP as backend.We can use  2 steps for sync 2 iredmail(or we can create data server for mail data as SAN,freenac...)
a/use rsync for this sync mail data
b/use master-slave ldap

Beside you can create cluster for 2 mail server use:heartbeat,VRRPD...

Thanks

10

Re: 1 to 1 sync between two iRedMail servers

Hi All !!!

Do Anyone make solution of conheotiensinh1983 to work ?
Please share some experiences to me !!!

Cheers

11

Re: 1 to 1 sync between two iRedMail servers

maxie_ro wrote:

I don't think that would work.
What I have in mind: A backup solution where both servers are fully functional and fully synchronized between themselves, and none of them is actually just a small backup with less functionality.
E.g., 2 iRedMail servers, A and B. Both are identical as domains and user accounts, both have the same priority in the DNS, so both receive mail. Also, some kind of round-robin in the DNS, so users which have accounts on them connect randomly on A and B.

@marie_ro:
Exactly this is it!

Round-robin not load balance should be the solution.

@whatislove:
You can´t do this with rsync, just DRBD and gfs.
I tested glusterFS - to slow and to much overhead on heavy loaded servers. Problems with NFS (v3) too, don´t touch it any more. V4 not tested!

mbsouth