Updated : How To Install & Configure Zimbra High Availability (HA)

Posted by

In the previous article, I am using DRBD + Heartbeat to achieve Zimbra HA. In this article, I am using DRBD + DRBD Reactor. Below is the topology

# Preparation

System Information

# Server 1
Hostname   : node1
Domain     : imanudin.web.id
IP Address : 192.168.2.101

# Server 2
Hostname   : node2
Domain     : imanudin.web.id
IP Address : 192.168.2.102

# Server 3 (quorum device)
Hostname   : node3
Domain     : imanudin.web.id
IP Address : 192.168.2.103

# Alias IP / Floating IP
Hostname   : mail
Domain     : imanudin.web.id
IP Address : 192.168.2.110

System Requirement

# node1 and node2

RAM : 10 GB
vCPU : 2
disk : /dev/sda (OS) and /dev/sdb (for DRBD)

# node3

RAM : 1 GB
vCPU : 1
disk : /dev/sda (OS)

Note: node3 is used as a witness/quorum device. I use 20GB for /dev/sda and 50GB for /dev/sdb. Please adjust according to your needs.

In this article, I am using Ubuntu 24.04

# Configuration
## Configure /etc/hosts on all nodes (node1, node2, and node3)

127.0.0.1 localhost
192.168.2.101   node1.imanudin.web.id   node1
192.168.2.102   node2.imanudin.web.id   node2
192.168.2.103   node3.imanudin.web.id   node3
192.168.2.110   mail.imanudin.web.id   mail

## Configure hostname

on node1

hostnamectl set-hostname node1

on node2

hostnamectl set-hostname node2

on node3

hostnamectl set-hostname node3

## Enable repository on all nodes

sudo add-apt-repository ppa:linbit/linbit-drbd9-stack
sudo apt update

## Install Packages on all nodes

apt install drbd-dkms drbd-utils
modprobe drbd

## Configure DRBD on all nodes

vi /etc/drbd.d/r0.res

Please fill with the following lines

resource r0 {

startup {
    wfc-timeout 120;
    degr-wfc-timeout 120;
}

protocol C;

device /dev/drbd0;
meta-disk internal;

on "node1" {
node-id 1;
address 192.168.2.101:7788;
disk /dev/sdb;
}

on "node2" {
node-id 2;
address 192.168.2.102:7788;
disk /dev/sdb;
}

on "node3" {
node-id 3;
address 192.168.2.103:7788;
disk none;
}

options {
auto-promote no;
quorum majority;
on-no-quorum io-error;
on-suspended-primary-outdated force-secondary;
on-no-data-accessible io-error;
}

connection-mesh {
hosts node1 node2 node3;
}

}

## Create metadata, start, and check status on all nodes

Run below command on node1 and node2

drbdadm create-md r0
drbdadm up r0

Run below command on node1 only

drbdadm new-current-uuid --clear-bitmap r0
drbdadm status

Run below command on node3

drbdadm up r0
drbdadm status

Please ensure all connection is UpToDate

## Mount and format DRBD (on node1)

Run below command only on node1

drbdadm primary r0
mkfs.xfs /dev/drbd0
mount /dev/drbd0 /opt

# Install Zimbra (on node1 and node2)

## Install dependencies

apt-get install -y dnsmasq bind9utils netcat-openbsd sudo libidn12 libpcre3 libgmp10 libexpat1 libstdc++6 libperl5.38t64 libaio1t64 unzip pax sysstat sqlite3 net-tools

## Disable services sendmail and postfix

systemctl stop sendmail
systemctl stop postfix
systemctl disable sendmail
systemctl disable postfix

## Setup resolv.conf

rm /etc/resolv.conf
echo "search imanudin.web.id
nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 1.1.1.1" > /etc/resolv.conf

## Disable systemd-resolved

systemctl stop systemd-resolved
systemctl disable systemd-resolved

## Setup local DNS

echo "server=8.8.8.8
mx-host=imanudin.web.id,mail.imanudin.web.id,10
host-record=imanudin.web.id,192.168.2.110
host-record=mail.imanudin.web.id,192.168.2.110" > /etc/dnsmasq.d/imanudin.web.id.conf

## Start and test DNSMasq

systemctl restart dnsmasq
host -t MX imanudin.web.id
host -t A mail.imanudin.web.id
dig MX imanudin.web.id

## Install Zimbra (on node1)

Set hostname and ip address for temporary on node1

hostnamectl set-hostname mail.imanudin.web.id
ip address add 192.168.2.110/24 dev ens18

Download, extract, and install Zimbra

cd /opt/
wget -c https://files.zimbra.com/downloads/10.1.0_BETA/zcs-NETWORK-10.1.0_BETA_4848.UBUNTU24_64.20260106140815.tgz
tar -xvf zcs-NETWORK-10.1.0_BETA_4848.UBUNTU24_64.20260106140815.tgz
cd zcs-NETWORK-10.1.0_BETA_4848.UBUNTU24_64.20260106140815
./install.sh

Please install Zimbra on node1 until finish

## Install Zimbra software only (node2)

Download, extract, and install Zimbra

cd /opt/
wget -c https://files.zimbra.com/downloads/10.1.0_BETA/zcs-NETWORK-10.1.0_BETA_4848.UBUNTU24_64.20260106140815.tgz
tar -xvf zcs-NETWORK-10.1.0_BETA_4848.UBUNTU24_64.20260106140815.tgz
cd zcs-NETWORK-10.1.0_BETA_4848.UBUNTU24_64.20260106140815
./install.sh -s

Please install and select the Zimbra package on node2 like the package on node1 until it is finished. Then, rebuild crontab and syslog

Rebuild crontab on node2

cp -pvr /var/spool/cron/zimbra  /tmp/zimbra.cron.BAK  
cat /opt/zimbra/conf/crontabs/crontab > /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.ldap >> /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.store >> /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.logger >> /tmp/cron.zimbra
cat /opt/zimbra/conf/crontabs/crontab.mta >> /tmp/cron.zimbra
echo "# ZIMBRAEND -- DO NOT EDIT ANYTHING BETWEEN THIS LINE AND ZIMBRASTART" >> /tmp/cron.zimbra 
crontab -u zimbra /tmp/cron.zimbra   
su - zimbra -c "zmschedulebackup -D"

Setup log

/opt/zimbra/libexec/zmsyslogsetup

# Setup Zimbra HA

After success installing Zimbra, stop service and rollback the hostname/ip address temporary on node1

on node1

su - zimbra -c 'zmcontrol stop'
hostnamectl set-hostname node1
ip address del 192.168.2.110/24 dev ens18

Unmount drbd devices

umount /opt
drbdadm secondary r0

## Disable services

Disable the dnsmasq and Zimbra services during boot. These services will be automatically run by drbd-reactor

on node1 and node2

systemctl disable --now dnsmasq
systemctl stop dnsmasq
systemctl disable zimbra

# Install and Configure DRBD Reactor

## Install DRBD Reactor

on node1 and node2

apt install drbd-reactor resource-agents-extra resource-agents-base

## Configure DRBD Reactor

on node1 and node2

vi /etc/drbd-reactor.d/r0.toml

Fill wit the following lines

[[promoter]]
id = "r0"
[promoter.resources.r0]
start = [
"""
ocf:heartbeat:Filesystem fs_zimbra device=/dev/drbd0 \
directory=/opt fstype=xfs run_fsck=no""",
"ocf:heartbeat:IPaddr2 virtual_ip cidr_netmask=24 ip=192.168.2.110",
"dnsmasq.service","zimbra.service",
]

## Enable and start drbd-reactor

on node1 and node2

systemctl enable drbd-reactor
systemctl restart drbd-reactor

on node3

systemctl enable [email protected]

# Test Zimbra HA

After start drbd-reactor, usually the service will automatically start on node1. After all services running well, you can test Zimbra HA by shutdown node1 or disable drbd-reactor service by the following command.

drbd-reactorctl disable --now

You can check the process via journalctl -f or drbd-reactorctl command

Good Luck 🙂

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.