Configure a loadbalancing cluster

Julien Groselle
Added over 9 years ago

Create a MailCleaner Cluster is a major feature of MailCleaner.

Installation

First, install each host independently.
During the installation process you need to well set up the HOSTID of your nodes :

Master : 
HOSTID = 1 

Node 01 : 
HOSTID = 2

Node 02 :
HOSTID = 3

After, you have to register all your nodes before configuring the cluster or add it into the cluster.

Once installed and registered, you will have to get the password created by the mailcleaner installation process.
This password is located in the file /etc/mailcleaner.conf. To iddentify it you can use this command:

cat /etc/mailcleaner.conf | grep MYMAILCLEANERPWD

Configuration

On the master:

  • Use the script located in /usr/mailcleaner/scripts/configuration/slaves.pl :
    • The first time, you will have to set the real hostname of the master, with option 1) (fully qualified hostname or ip). (by default it is 127.0.0.1).
    • Then select option 4) to add a slave and enter the hostname or ip and the password of the host.
    • Back in the main menu, hit “q” to apply changes.

On the slave:

  • Use the script located in /usr/mailcleaner/scripts/configuration/slaves.pl.
    • The first time, you will have to set the real hostname, with option 1) (fully qualified hostname or ip). (by default it is 127.0.0.1).
    • Then select option 5) to set this host as a slave. Enter master hostname or ip and password.
    • Back in the main menu, hit “q” to apply changes.

Utilisation

You can now reach the admin interface of any host, but only the master will let you configure the system.
It also is the only one that users can reach in order to acces their quarantine.

In order to balance your incoming mail on the two (or more) nodes you can add a new MX record with the same priority pointing the second node.