1

Topic: Replicate Server

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: Ubuntu 14
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  Mysql
- Web server (Apache or Nginx): Nginx
====

I have a main iredmail server, and I want to create a replicate server, not HA, only keep server ready to use in case main server is out service.
Is there any manual or tutorial?

Thanks.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Replicate Server

I would install a fresh server, and then use rsync to copy all files using a cron script.
Make sure that all mail items in /var/vmail/ and the backup files for ldap and/or sql server are copied as well.
Verify by doing a restore of the ldap/sql database manually.
You would need to manually set the correct IP adress of your mail host, in order to allow incomming mail of course.
Both the dataabse restore and IP address change can be scripted, with not to much effort

Another way, if using a virtual server in a modern hypervisor, is to use  vm snapshots.
If using linux LVM, it might be possible to use lvm snapshot, and export to second host. I have never tried this myself, but hey... google knows. The same goes for ZFS and snapshots.

In my case, I use Bareos backup (open source), + the ReAR option. Then it is possible to create a boot USB (or PXE), doing over the network installation and bare metal recovery using the last backup.
Regards, I

3

Re: Replicate Server

swejun wrote:

I would install a fresh server, and then use rsync to copy all files using a cron script.
Make sure that all mail items in /var/vmail/ and the backup files for ldap and/or sql server are copied as well.
Verify by doing a restore of the ldap/sql database manually.
You would need to manually set the correct IP adress of your mail host, in order to allow incomming mail of course.
Both the dataabse restore and IP address change can be scripted, with not to much effort

Another way, if using a virtual server in a modern hypervisor, is to use  vm snapshots.
If using linux LVM, it might be possible to use lvm snapshot, and export to second host. I have never tried this myself, but hey... google knows. The same goes for ZFS and snapshots.

In my case, I use Bareos backup (open source), + the ReAR option. Then it is possible to create a boot USB (or PXE), doing over the network installation and bare metal recovery using the last backup.
Regards, I

Thanks you for your reply, only both doubts and explication:

I actually use as main server a physical server but I want to create a virtual server with openVZ. In that server I will create a replicate server.
So, my idea is to install a fresh server, install iredmail and rsync mails, configs and BD. Do you advice that install fresh server and after replicate all files? what directory should I copy in that case?

I use backuppc to do daily copys, but its very interesting your option.

Thanks again.

4

Re: Replicate Server

Few solutions:

*) A classic fail-over cluster uses a shared storage, place all data which should be shared by both servers on the shared storage, and there's only one server running all required services, the other one just stand by. When the active one is down, the stand-by server will take all services and mount shared storage to become the active one. Similar to this fail-over cluster setup, you can setup 2 servers with a shared storage, no need to setup fail-over softwares, but stop active one and start standby one MANUALLY - if the downtime is acceptable to you.

We have a working load-balance iRedMail cluster in production, but no fail-over cluster solution yet.

*) Another solution:

- Setup MySQL/PostgreSQL/OpenLDAP to sync mail accounts between 2 servers INSTANTLY.
- Setup Dovecot Replicate to sync mailboxes between 2 servers INSTANTLY.

We offer paid support if you need this setup.

5

Re: Replicate Server

Thanks Zhang, so, if I install all from a fresh linux and sync content, would be enough?
Should I only sync mysql and ldap tables?

Mails, DB, any more?

I consider your idea to use a paid support, but I would like to try it myself.

Thanks.

6

Re: Replicate Server

aarango wrote:

if I install all from a fresh linux and sync content, would be enough?
Should I only sync mysql and ldap tables?

You may need to sync data which will be used by both servers.

For config files, put them on shared storage is fine. But if you're familiar with Ansible/Puppet/Chef/etc, you can update config files at the same time on both (as many as you want) servers to get same settings.

7

Re: Replicate Server

ZhangHuangbin wrote:
aarango wrote:

if I install all from a fresh linux and sync content, would be enough?
Should I only sync mysql and ldap tables?

You may need to sync data which will be used by both servers.

For config files, put them on shared storage is fine. But if you're familiar with Ansible/Puppet/Chef/etc, you can update config files at the same time on both (as many as you want) servers to get same settings.

Thanks Zhang, in this days I will test it.