1

Topic: iredmail HA with zero downtime

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:  Ubuntu 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? Non pro
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi All,

Any suggestion on how to configure iredmail 1.3.1 high availability with zero downtime using two (2) physical servers?

I configured nagios to send me alert regarding postfix (deferred,bounced,corrupt,drop emails) using check_postfix_mailqueue (please see attached file) but this doesn't help with the purpose of having HA and zero downtime.

I have read documents about iredmail failover cluster with KeepAlived, HAProxy, GlusterFS but it requires four (4) servers (docs.iredmail.org/haproxy.keepalived.glusterfs.html)

Thanks,
JunG

Post's attachments

nagios postix monitoring.JPG 76.62 kb, 1 downloads since 2020-08-13 

You don't have the permssions to download the attachments of this post.

----

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

2

Re: iredmail HA with zero downtime

You won't get any HA with 2 servers only. HA usually isn't that simple and requires a lot of knowledge & money to set up.

I would suggest to hire an IT professional to plan your setup.

3

Re: iredmail HA with zero downtime

hws wrote:

You won't get any HA with 2 servers only. HA usually isn't that simple and requires a lot of knowledge & money to set up.

I would suggest to hire an IT professional to plan your setup.

Hi HWS,

Don't worry i can do it myself. but what we are talking here is, on how we can save money that's why i'm asking any suggestion. Maybe there somebody here who implemented HA at lower cost...

Anyway thanks for your suggestion.

Jung.

4

Re: iredmail HA with zero downtime

Jung, were you able to accomplish this? I too am interested...

jung wrote:
hws wrote:

You won't get any HA with 2 servers only. HA usually isn't that simple and requires a lot of knowledge & money to set up.

I would suggest to hire an IT professional to plan your setup.

Hi HWS,

Don't worry i can do it myself. but what we are talking here is, on how we can save money that's why i'm asking any suggestion. Maybe there somebody here who implemented HA at lower cost...

Anyway thanks for your suggestion.

Jung.

5

Re: iredmail HA with zero downtime

mmonteusa wrote:

Jung, were you able to accomplish this? I too am interested...

jung wrote:
hws wrote:

You won't get any HA with 2 servers only. HA usually isn't that simple and requires a lot of knowledge & money to set up.

I would suggest to hire an IT professional to plan your setup.

Hi HWS,

Don't worry i can do it myself. but what we are talking here is, on how we can save money that's why i'm asking any suggestion. Maybe there somebody here who implemented HA at lower cost...

Anyway thanks for your suggestion.

Jung.


@mmonteusa

I am not able to successfully implement HA using 2 Ubuntu Server 22.04 using the below:

I've installed pacemaker/corosync with mariadb galera on 2 servers. Installed Iredmail on Server A then deleted the database on Server A before installing the Iredmail on Server B. 

(Note: I've successfully implemented the solution above on my Nextcloud on premise server. Wherein whatever you've done on server a or b will be replicated vice -versa and they are sharing 1 database.)

Hope somebody who implemented the above requirements will share their ideas.

Thanks.
Jung

6 (edited by Chrissicom 2023-05-15 21:23:56)

Re: iredmail HA with zero downtime

HA is no completely defined term. It just means you want mail services to stay availability under specific conditions (e.g. during update of a server). Your SLA sets the requirements for your availability.

I have setup two iRedMail servers and sync the mailboxes with dsync. I am using the MariaDB version in a master-master replication setup. Nothing else is different from a single iRedMail server except that I copied over SpamAssassin rules and custom Nginx settings. Sogo is setup separately on both servers so I can test version upgrades on one of them.

By the terms of your SLA this may not be "HA" but it ensures mail services uptime during maintenance or unscheduled downtime of (one) of the servers. Since the servers are in different countries there is a good level of geo-redundancy as well. Regular backups are not replaced by this setup. If both servers are down ... well ;-)

As for the network I didn't setup anything specific in terms of "HA" since both servers are in different countries and I have 3 additional DNS servers for name resolution, I see no reason for any additional measures for my requirements. The example you find with keepalived and so on is overkill and not needed if you don't have a problem with using multiple MX records with different IPs in DNS. There is no need for a failover IP in such a setup.

PS Just to make clear my setup does not replace any load balancing mechanisms, but as you said you know this stuff so you know that load balancing, failover and high availability are all different terms with the latter being nothing with a clear definition as I initially said and it can actually include the first two terms.

7

Re: iredmail HA with zero downtime

Since I was not able to do the HA (using 2 servers). What I did was setup two(2) iRedMail servers (Identical in terms of configuration) with the same emails and usernames then use rsync to synchronize the mailboxes from Primary server to Secondary server.

For newemail, I will create in Primary and also in Secondary server

8

Re: iredmail HA with zero downtime

jung wrote:

Since I was not able to do the HA (using 2 servers). What I did was setup two(2) iRedMail servers (Identical in terms of configuration) with the same emails and usernames then use rsync to synchronize the mailboxes from Primary server to Secondary server.

For newemail, I will create in Primary and also in Secondary server

What you did was creating a hot standby server. This has nothing to do with HA. It just speeds up the time to recover from a problem a little bit, since you do not need time to restore a backup.

9

Re: iredmail HA with zero downtime

hws wrote:
jung wrote:

Since I was not able to do the HA (using 2 servers). What I did was setup two(2) iRedMail servers (Identical in terms of configuration) with the same emails and usernames then use rsync to synchronize the mailboxes from Primary server to Secondary server.

For newemail, I will create in Primary and also in Secondary server

What you did was creating a hot standby server. This has nothing to do with HA. It just speeds up the time to recover from a problem a little bit, since you do not need time to restore a backup.


@hws,

Yes, that's correct.

10 (edited by chris.23lo 2023-05-23 18:08:07)

Re: iredmail HA with zero downtime

Some ideas can share with worth for exploring.

- proxmox with 3 servers, ceph storage, you get HA, data store mobility
- if you dont trust ceph (software afterall), you can get your synology x 2 with replication and snapshot.

here we have brandname HCI, HA and replicas are already available.