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:
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
-
The following Ansible Galaxy Collections:
carbonio_kafka
,carbonio_patroni
, andcarbonio_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.
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:
-
kafka
group, which will point to the Nodes where kafka will be installed: these are the three Cluster Nodes. To each Node, add thebroker_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
-
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.
-
To the
postgresServers
group you need to add two variables:postgres_version
is the PostgreSQL version (16), andpatroni_role
can be set toprimary
for initial master orsecondary
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
-
The variable
ldap_role
must be added to themasterDirectoryServers
group, and can assume the valuesmaster
for initial master ormmr
for new extra master#masterDirectoryServers group [masterDirectoryServers] srv1.example.com ldap_role=master srv3.example.com ldap_role=mmr
-
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
[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.