1. Knowledge Base
  2. MDaemon® Email Server

MDaemon Clustering - Deployment requirements and how to configure nodes

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.

  1. 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.
    1. 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.
    2. The XML-API on secondary nodes is read only.
    3. 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.
  2. Each node in the cluster requires its own unique MDaemon key.
  3. 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.
  4. 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.
  5. 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
  6. 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.
  7. 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. 
  8. Each node in the cluster needs to be running the same version of MDaemon.
  9. 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.
  10. SSL Certificates are automatically replicated from the Primary to Secondary nodes.
    • MDaemon replicates its certificate settings. Each node/server in the cluster 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.
    • LetsEncrypt has not been updated to handle secondary nodes at the moment.
  11. 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. 
  12. 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.
  13. Attachment linking cannot be used in a cluster.  If enabled, any attachments extracted by secondary servers will become inaccessible and orphaned. 
  14. 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:

  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. Select Enable the Cluster Service
  6. 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.
  7. 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.
  8. Click Ok.
  9. Check the Plug-ins / 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.