User Mail Replica Installation#

The main part of the installation is the set up of the User Mail Replica infrastructure, which will be built on the scenario described in the previous section.

In order to complete the User Mail Replica configuration, you need access to the Ansible’s Control Node and of the following items:

  1. The inventory file you used in previous section, which you must edit according to the directions you will find in the reainder of this page

  2. The following Ansible Galaxy Collections: carbonio_kafka, carbonio_patroni, and carbonio_ldap that you can install with command

    # ansible-galaxy collection install zxbot.carbonio_kafka
    # ansible-galaxy collection install zxbot.carbonio_patroni
    # ansible-galaxy collection install zxbot.carbonio_ldap
    

Prepare inventory#

After the standard Carbonio installation has completed successfully, you should have the following inventory files:

  • inventory

  • inventory_postgrespassword

  • inventory_ldap_passoword

  • inventory_consulpassword

To configure the inventory for Redundant with User Mail Replica installation, you will need to add new groups and add specific variables to the inventory file. Please read the following advises if you plan to add the User Mail Replica infrastructure to different Node than the one we will use in the remainder of the scenario.

Guidelines for Components in User Mail Replica Configuration

The initial Components assigned during the standard installation (i.e., as master for LDAP or primary for PostgreSQL) should remain on the servers that were configured in the standard installation. Some services and configurations have already been initialised based on this setup, so:

  • Do not assign the master role (for LDAP) or the primary role (for PostgreSQL) to any additional servers being configured as extra masters.

  • If you plan to add extra master servers, configure them with roles mmr for Directory Server and secondary for PostgreSQL in the Ansible inventory file.

This approach ensures that the pre-existing configurations and initializations remain stable and compatible with the User Mail Replica deployment.

The two new groups to add at the bottom of the file are:

  1. kafka group, which will point to the Nodes where kafka will be installed: these are the three Cluster Nodes. To each Node, add the broker_id variable with a different value:

    #kafka group
    [kafka]
    srv1.example.com broker_id=1
    srv2.example.com broker_id=2
    srv3.example.com broker_id=3
    
  2. zookeeper_servers group, which is no longer used and needs to be kept empty

    #zookeeper_servers group
    [zookeeper_servers]
    

You need also to add variable to existing groups.

  1. To the postgresServers group you need to add two variables: postgres_version is the PostgreSQL version (16), and patroni_role can be set to primary for initial master or secondary for new extra master:

    #postgresServers group
    [postgresServers]
    srv1.example.com postgres_version=16 patroni_role=primary
    srv2.example.com postgres_version=16 patroni_role=secondary
    
  2. The variable ldap_role must be added to the masterDirectoryServers group, and can assume the values master for initial master or mmr for new extra master

    #masterDirectoryServers group
    [masterDirectoryServers]
    srv1.example.com ldap_role=master
    srv3.example.com ldap_role=mmr
    
  3. The dbsConnectorServers group must be filled out. DB Connectors will be moved from the Postgres Node to both Mailstore & Provisioning Nodes, because at least one of them must always be available at anytime and provide User Mail Replica.

    #dbsConnectorServers group
    [dbsConnectorServers]
    srv8.example.com
    srv9.example.com
    

The complete inventory file, filled according to the directions above, can be seen and downloaded here.

Inventory - Redundant with User Mail Replica Scenario

Download_inventory

[kafka]
srv1.example.com broker_id=1
srv2.example.com broker_id=2
srv3.example.com broker_id=3

### Keep this section empty for backward compatibility
[zookeeper_servers]


[postgresServers]
srv1.example.com postgres_version=16 patroni_role=primary
srv2.example.com postgres_version=16 patroni_role=secondary

[masterDirectoryServers]
srv1.example.com ldap_role=master
srv3.example.com ldap_role=mmr

[replicaDirectoryServers]

[serviceDiscoverServers]
srv1.example.com
srv2.example.com
srv3.example.com

[dbsConnectorServers]
srv8.example.com
srv9.example.com

[mtaServers]
srv4.example.com
srv5.example.com

[proxyServers]
srv6.example.com
srv7.example.com

[proxyServers:vars]
webmailHostname=YourWebmailPublicHostname

[applicationServers]
srv8.example.com
srv9.example.com

[filesServers]
srv10.example.com
srv11.example.com

[docsServers]
srv12.example.com
srv13.example.com

[taskServers]
srv10.example.com
srv11.example.com

[previewServers]
srv12.example.com
srv13.example.com

### The IP address(es) might be the same, see section UDP Video
### Streaming

[videoServers]
srv14.example.com public_ip_address=x.y.z.t
srv15.example.com public_ip_address=w.u.v.s

[prometheusServers]
srv3.example.com

[syslogServer]
srv3.example.com

[workStreamServers]
srv10.example.com
srv11.example.com

Install Kafka#

To install Kafka, use the necessary playbook from carbonio_kafka collection:

# ansible-playbook -i inventory zxbot.carbonio_kafka.carbonio_kafka_install

Install PostgreSQL HA#

PostgreSQL uses HAProxy to add load balancing, health checks, and more. The HAProxy installation has been automated with Ansible and is included in the carbonio_patroni playbook. First, install the PostgreSQL replica

# ansible-playbook -i inventory zxbot.carbonio_patroni.carbonio_replica_postgres_install

Then install carbonio_patroni

# ansible-playbook -i inventory zxbot.carbonio_patroni.carbonio_patroni_install

This task also moves DB Connectors from the PostgreSQL Node to DB Connectors Node, if needed, as defined on the inventory file. This setup allows DB Connectors to connect to an available PostgreSQL Node managed by Patroni.

Install Multi Master LDAP#

To install the Multi-Master LDAP server, use the appropriate collection:

ansible-playbook -i inventory zxbot.carbonio_ldap.carbonio_install_mmr

User Mail Replica management#

CLI commands to manage the User Mail Replica, to promote and replicate accounts on other Mailstores, can be found in the dedicated section User Mail Replica Usage.