Multiserver - Using shared storage for vmail data

Discussion in 'Installation/Configuration' started by The_Cook, Oct 11, 2024.

  1. The_Cook

    The_Cook New Member

    Hi Members,

    Apologies for the long post....

    * I'm unable to add links to my post so if you need to look, please just copy paste into your browser...
    This is my first time I am setting ISPConfig up as a multiserver and am confused around the replication setup for mail as I want to do this slightly differently from the documentation. I'd like to setup MX1 and MX2 as load-balanced mail servers and use NFS as shared storage for mail data between them.
    • I have gone through the documentation several times to try and make this work. I'm looking at the bottom of:
      howtoforge.com/tutorial/ispconfig-multiserver-setup-debian-ubuntu/3/
      particularly 4.3 'Setting up replication for Dovecot' where it details setting up Rsync to replicate data between MX1 and MX2. This replicates the /var/vmail data on both MX1 and MX2 servers.
    • I have read the following thread and post number 4 is the kind of setup I am looking for:
      forum.howtoforge.com/threads/multiple-ispconfig-servers-only-for-mail-services.92499/#post-457340
      but using NFS/CIFS share mounted on a ZFS pool.
    • I have also today seen this post:
      forum.howtoforge.com/threads/multiserver-setup-web-file-and-db-replication-of-web-content.93173/#post-460923
      where you say that ISPConfig doesn't replicate data, just settings and "by leaving out the steps to mirror the FS (or replacing it with shared storage) can not work."

    What I have setup so far:
    I have setup /var/vmail as per the documentation:
    howtoforge.com/use_mount_bind_to_move_the_website_and_email_directory_of_a_ispconfig_server_to_a_new_location
    but changed this to use NFS mounted shared storage.
    What would the 'dovecot_custom.conf.master' look like without /var/vmail replication?

    Thank you for any advice regarding this kind of setup.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Install a NFS server.
    2) Install your mail servers with ISPConfig, where the second server mirrors the first one in ISPConfig.
    3) Mount /var/vmail on both servers from your NFS server

    Your setup does not use replication as you use shared storage, so you don't add anything to that file, except maybe some settings that Dovecot recommends for NFS setups:
    https://doc.dovecot.org/2.3/configuration_manual/nfs/

    One issue you might run into is regarding a director. ISPConfig uses Mialdir as storage by default.
     
    remkoh and ahrasis like this.
  3. The_Cook

    The_Cook New Member

    Hi Till.
    Thanks for your quick response last week.

    I have spent some days researching/reading/testing and it seems like there are a lot of added complexities just to switch to shared storage. The ultimate setup here is as you say, with 3 x physical servers, a CEPH data backend and Dovecot Directors.

    As I only have 2 servers my plan was to run MX1 and MX2 as 2 VM's on separate physical severs and add an NFS share from the local host on that server to the VM on that server, just so the storage isn't within the VM itself. Then sync the storage between the 2 hosts by some other method (drbd/lsyncd). This also means the storage can be de-mounted and re-mounted by a replacement/updated/reconfigured MX VM as the storage is separate from it.
    So its not really shared between the VMs, its just accessed in that way to separate it. The storage on each host is ONLY accessed by the MX VM on that host.
    I think I can still do this with your dsync setup within the multiserver documentation and setting up NFS on the host.

    From what I've read on dsync, it can be used as Master/Master but a mailbox can be accessed by either Master (MX1 or MX2) and that can cause inconsistencies within the 2 data backends. This is only temporary until dsync brings them back into sync and fixed with a reload of the emails on the client devices. It can also be reduced by configuring 'sticky sessions' on the load balancer in front of MX1 & MX2.

    Dovecot Director solves this by tracking the logins for the mailboxes and always forwarding access to the same mailbox through the same MX VM. However, this is not compatible with dsync and is really only used with CEPH or other distributed file systems.

    I think I understand that correctly above.
    If anyone here has experience of dsync in production setup between 2 physical servers as Master/Master then any advice on issues, pitfalls and limitations would be really appreciated.

    Thanks guys.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Check out the ISPConfig Multiserver setup guide. It contains a well-working synced two-server dovecot setup:

    https://www.howtoforge.com/tutorial/ispconfig-multiserver-setup-debian-ubuntu/
     
    ahrasis and The_Cook like this.

Share This Page