MDaemon's Cluster Service is designed to share your configuration between two or more MDaemon servers on your network.
Clustering 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.
MDaemon version 20.0.0 includes support for configuring MDaemon in clustered nodes. MDaemon versions 19.5 and below do not support clustering.
- A 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 primary node is the only node that can be used to make configuration changes. If you happen to make configuration changes on a secondary server, they will be over written. Most of the UI on secondary servers has been disabled.
- The XML-API on secondary nodes is read only.
- Changes to email that happen on secondary nodes are sent to the primary node, and the primary node then notifies all other nodes about the change.
- Each node in the cluster requires its own unique MDaemon key.
- MDaemon does not handle the routing of any traffic. A third party load balancer to handle the routing of traffic is recommended.
- This is most important for Webmail and Remote Administration (MDRA) traffic as they are not cluster aware. Session information for Webmail and MDRA is not passed between the nodes. When logging in to Webmail or MDRA on a specific server, all traffic for that session needs to be routed to that server.
- Enabling sticky sessions is required in your load balancer so that all traffic from the same IP is routed to the same host.
- All HTTP and XMPP traffic should be routed to the primary node. This is the easiest and least confusing method. There are multiple reasons for this. If you are not using items mentioned below, then you can configure it however you’d like. Sticky sessions are still required.
- The XMPP server is not cluster aware. If using the IM capabilities, all XMPP traffic must go to the same server.
- MDRA is not cluster aware. If MDRA traffic is routed to a secondary server, changes will be over written. MDRA traffic must be routed to the primary node.
- Webmail traffic needs to be routed to the same server as XMPP traffic or the Webmail IM functionality will not work.
- Mailboxes must be stored in a shared path that is accessible by each node in the cluster. If using a UNC path, the MDaemon service must be ran as a user that has access to the network location.
- It is a manual process to move the contents of the mailboxes and update the mailbox paths in MDaemon.
- The new account template will be updated with the mailbox path provided in the clustering configurations
- Public folders must be stored in a shared path that is accessible by each node in the cluster.
- It is a manual process to move the data to the shared location.
- The cluster service will update the MDaemon.ini file with the public folder path provided in the Clustering configurations.
- Each node in the cluster needs to be on the same network. We do not recommend using this to cluster servers that are in different locations.
- Each node in the cluster needs to be running the same version of MDaemon.
- Dynamic screening sends all requests to the primary server, and the data from the primary server is replicated to secondary servers.
- If the primary is offline, secondary servers use their own dynamic screening configurations which should be identical to the configuration on the primary at the time it went offline. When the primary comes back online, any changes to DS made by the secondary servers will be over written.
- If the primary fails, issues may arise with trying to thaw an account via email that was frozen while the primary was offline.
- Each node is expected to have the correct certificates installed. Certificates need to be manually moved to each node in the cluster.
- LetsEncrypt has not been updated to handle secondary nodes at the moment.
- The Lockfiles directory must be a shared location. The Clustering Service can do this automatically. To manually configure, edit the path in the LockFiles= key in the [Directories] section of the \MDaemon\App\MDaemon.ini file.
- The \MDaemon\PEM directory must be a shared location. Editing the PEM key in the [Directories] section of the \MDaemon\App\MDaemon.ini file. Copy the MDaemon\PEM\ folder to the new shared location and restart MDaemon.
- Attachment linking cannot be used in a cluster. If enabled, any attachments extracted by secondary servers will become inaccessible and orphaned.
- All nodes in a cluster should be configured to use the same time zone and the times should be the same. 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:
- 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.
- All the appropriate certificates should be installed on each node.
- Install MDaemon on a secondary node using a unique key.
- On the primary node, go to Setup > Cluster Service.
- Select Enable the Cluster Service
- Right-click the list of Registered Servers, and click Add new MDaemon server to cluster
- This may be slow because it is searching the network for available servers.
- In Server Name, enter the NETBIOS name, IP address, or DNS name of the secondary node MDaemon is installed on, or select the server from the drop-down list—there may be a delay as it is searches the network for available servers.
- Click Ok.
- Check the Plug-ins / Cluster log to ensure the two servers were connected and that replication is occurring.
- Go to Setup > Cluster Service on the secondary node to confirm that it now also lists the primary and secondary nodes under Registered Servers.
- Configure your load balancing hardware or software to route traffic to the cluster as discussed above.