Cluster Service

MDaemon's Cluster Service is designed to share your configuration between two or more MDaemon servers on your network. This makes it possible for you to use load balancing hardware or software to distribute your email load across multiple MDaemon servers, which can improve speed and efficiency by reducing network congestion and overload and by maximizing your email resources. It also helps to ensure redundancy in your email systems should one of your servers suffer a hardware or software failure.

Here are a number of things to consider when deciding whether or not to set up an MDaemon cluster on your network:

Nodes

An MDaemon cluster will have a primary node and secondary nodes. One MDaemon server will be designated as Primary and all the others will be Secondary.

The MDaemon server acting as the primary node has its configuration replicated on all other nodes. Thus the primary node is the only node that can be used to make configuration changes; if you access a secondary node and make configuration changes, those changes will be overwritten. Consequently, most configuration options aren't accessible in the user interface on secondary nodes.

The cluster service does not replicate mailbox folders or public folders across nodes; all nodes share the same set of message folders. User mail folders and public folders must be at a location on your network that is accessible to all nodes.

Any changes to email that happen on a secondary node are sent to the primary node and then all other nodes are notified of the change.

The XML-API on secondary nodes is read only.

Each node in the cluster should be on the same network. We do not recommend using the cluster service to cluster servers that are in different locations.

Each node in the cluster needs to be running the same version of MDaemon.

Each node in the cluster requires its own MDaemon key.

Routing

MDaemon does not handle the routing of any traffic to or from specific nodes. We recommend that you use a third-party load balancer to handle the routing of traffic.

Sticky sessions in your load balancer is required so that all traffic from the same IP is routed to the same host. Sticky sessions is most important for MDRA, Webmail, and XMPP traffic as they are not yet cluster aware, which means session information is not passed between the nodes. To deal with this limitation:

All MDRA connections must be routed to the primary node.

When someone logs in to Webmail on a specific server, all traffic for that session must be routed to that same server.

Webmail and XMPP traffic needs to be routed to the same server in order for Webmail's built-in chat features to work.

All XMPP traffic must be routed to the same node, otherwise users connecting to different servers would not be able to chat with each other.

Considering the above points, we recommend that all HTTP and XMPP traffic be routed to the primary node, as that is the easiest configuration and least likely to cause any problems. If you are not using some of these features, however, you could alter your configuration (although sticky sessions are still required).

Mailboxes and Folders

Mailboxes, Public folders, and some other folders must be stored in a shared path that is accessible by each node in the cluster. Remember if you are using a UNC path you will need to run the MDaemon service as a user that has access to the network location.

You must manually update your mailbox and folder paths and move the contents of the folders to the cluster accessible location. This is not an automated function that MDaemon can perform for you when setting up clustering. The cluster service will update the MDaemon.ini file with the network folder paths for Mailboxes and Public Folders that you provide in your cluster service configuration.

The Lockfiles directory must to be moved to a shared location. You can You can allow the Clustering Service to do this automatically, or you can do it manually by editing the LockFiles key in the [Directories] section of the MDaemon.ini file. If you allow the clustering service to do it for you, the LockFiles directory will be located under the Network Mailbox path.

The PEM directory also must be moved to a shared location. To do this, copy the MDaemon\PEM\ folder to the new shared location, edit the PEM key in the [Directories] section of the MDaemon.ini file and restart MDaemon..

The new account template will be updated with the mailbox path provided in the cluster service configuration.

Dynamic Screening

Dynamic screening sends all requests to the primary server node, and the data from the primary node is replicated to secondary nodes.

If the primary node is offline, secondary nodes use their own dynamic screening configuration, which should be identical to the configuration on the primary node at the time it went offline. When the primary comes online, any changes to Dynamic screening made by the secondary servers will be overwritten.

Certificates

Certificates need to be manually copied and installed on each node in the cluster. MDaemon will not replicate certificates to secondary nodes, so each node must have the correct certificates installed. 

MDaemon does, however, replicate its certificate settings, so each server in the node will attempt to use the same certificate. If a node does not have the correct certificate all SSL/TLS/HTTPS traffic will fail on that node.

MDaemon's LetsEncrypt options do not support secondary nodes at this time.

Other

Attachment linking cannot be used in a cluster and is therefore disabled when you enable clustering.

All nodes in a cluster should be set to the same time zone, and set to the exact same time. If the time zone is not the same, or if the times are off by more than 1 second, a warning will be logged in the Cluster log.

Configuring the Cluster Service

 

Follow these steps to set up your cluster service:

1.Make sure that you have updated all mailbox paths and adjusted the public folder paths. The primary server should be using a network storage location for this data and should be able to access the data without any issues prior to proceeding.

2.All the appropriate certificates should be installed on each node.

3.Install MDaemon on a secondary node using a unique key.

4.On the primary node, go to Setup » Cluster Service.

5.Click Add (This may be slow because it is searching the network for available servers).

6.Under Server Name, enter the NETBIOS name of the secondary node MDaemon is installed on.

7.Choose a Server ID number.

8.Click Ok.

9.Check the Plugins / Cluster log to ensure the two servers were connected and that replication is occurring.

10.Go to Setup » Cluster Service on the secondary node to confirm that it now also lists the primary and secondary nodes under Registered Servers.

11.Configure your load balancing hardware or software to route traffic to the cluster as discussed above.

 

Options/Customize

Enable the Cluster Service

Click to enable the Cluster Service.

Diagnostics

Log level

MDaemon's Cluster Service supports six levels of logging, from the highest to lowest amount of data logged:

Debug

This is the most extensive log level. Logs all available entries, and is typically only used when diagnosing a problem, or when the administrator wants detailed information.

Info

Moderate logging. Logs general operations without details. This is the default log level.

Warning

Warnings, errors, critical errors, and startup/shutdown events are logged.

Error

Errors, critical errors, and startup/shutdown events are logged.

Critical

Critical errors and startup/shutdown event are logged.

None

Only startup and shutdown events are logged. If logging is disabled globally, then nothing is logged.

View/Analyze Log

Click this button to open the MDaemon Advanced System Log Viewer.

Replication Options

Enable real-time updates

By default, whenever a change occurs on the Primary node, it sends a replication signal to the Secondary nodes, to notify them that they need to make a replication request to sync the settings between the nodes.

Mirror Primary Queue states to Secondaries

Check this box if you wish to ensure that if you change a mail queue's state (i.e. frozen or thawed) on the Primary node, that state will be changed on the Secondary nodes also.

Replication interval [xx] minutes

This option determines how long a Secondary node will wait for a replication signal from the Primary node before making a replication request anyway. By default this is set to 30 minutes.

Registered Servers

This displays all the nodes in your MDaemon server cluster.

Add

Click this button to add a node to the cluster. There may be a delay at first because it is searches the network for available servers. On the screen that opens you will enter the NETBIOS name of the server on which MDaemon is installed, and add a server ID/node number.

Remove

To remove a node, select the entry and click Remove.

Promote

To change a Secondary node to the Primary node, on the Secondary that you wish to promote, select the node in the list and click Promote. The new Primary should then inform the old Primary to rejoin the cluster as a secondary. For setups with multiple secondary nodes, the additional secondary nodes will need to be removed and re-added to the cluster.