Multiserver setup

Discussion in 'Installation/Configuration' started by Canefield, Apr 19, 2021.

  1. Canefield

    Canefield New Member

    Dear all,

    Goal:
    1. Affordable multiserver setup, with just two (maybe three) virtual servers while everything is duplicated (web+files, mail, db, dns).
    2. Ensure that all servers can operate independently and at the same time are in sync.
    3. In the event of a disruption, being able to switch quickly to one of the other servers (changing master or any other way).

    I'm using Debian 10 (Buster) and have read and/or followed:
    1) The Perfect Server - Debian 10 (Buster) with Apache, BIND, Dovecot, PureFTPD and ISPConfig 3.2 (howtoforge.com)
    2) ISPConfig Perfect Multiserver setup on Ubuntu 20.04 and Debian 10 (howtoforge.com)
    3) Installing a Web, Email & MySQL Database Cluster on Debian 8.4 Jessie with ISPConfig 3.1 (howtoforge.com)
    4) Setting up Master-Master Replication with MySQL on Debian 8 (Jessie) (howtoforge.com)
    5) Setting Up A High-Availability Load Balancer With HAProxy/Keepalived On Debian Lenny - Page 2 - Page 2 (howtoforge.com)

    At the moment I've got up and running a MASTER and a SLAVE server. So just two virtual servers. In general I've followed the '1) The Perfect Server - Debian 10 (Buster) with Apache' and the duplication methods described in '2) ISPConfig Perfect Multiserver setup on Ubuntu 20.04 and Debian 10 (howtoforge.com)' & '3) Installing a Web, Email & MySQL Database Cluster on Debian 8.4 Jessie with ISPConfig 3.1 (howtoforge.com)'. So for the second server a database with a different name (dbispconfig2) from the original (dbispconfig) -to avoid possible conflicts- as well as dsync (dovecot/doveadm) for all mails and unison to replicate all files located in '/var/www' and configured this server (SLAVE) as mirror of the MASTER server (a.k.a. 'Is mirror of Server' in the GUI). So it seems all to be working as it should.

    However I've got my reservations:
    #1 Is this MySQL/MariaDB Master/Master Replication my best option? Or would a MASTER/SLAVE (async) be more than fine?
    #2 How easily is it to switch from the active MASTER to the second MASTER (Master/Master Replication; sync) in case of an unforeseen event?
    #3 How easily is it to switch from the active MASTER to the second SLAVE MASTER/SLAVE; async) in case of an unforeseen event?
    #2+3 Are any of these scenario's written down? So to switch active server or reinstall new server and sync. I've found any clear documentation.
    #4 Should I install HAProxy to provide LB/FO? I'm afraid that this announces my third server?


    Many thanks in advance,
    Canefield
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You should use just to set up your servers. I would strongly advice you to spread it over separate systems but if you want to use just one master and slave, simply add the necessary arguments to the autoinstaller script. Follow https://www.howtoforge.com/tutorial/ispconfig-multiserver-setup-debian-ubuntu/ and nothing else.

    I think unison is not fast enough to sync acme challenges and stuff like that. So you should use a mounted network storage.

    There have been several discussions about best practices for such setups in the past, so browse the forum and read about it.
     
  3. Canefield

    Canefield New Member

    @Th0m; thanks for your reply.
    #1 I only got two VPS servers (so no local network) and trying to setup the best and affordable (with two, maybe three VPS's) ISPConfig Multiserver environment. Let's assume for the time being I want to finish my job with just two VPS's. So to be more precise:
    1x MASTER SERVER with Web, Mail, DB and DNS
    1x SLAVE SERVER with Web, Mail, DB and DNS as mirror of the MASTER SERVER
    #2 Due the fact the servers aren't in a local network (two different VPS's) I thought using Unison to replicate all files would do the trick. What other alternative can you help me out with?

    With the mentioned tutorial we create a Master/Slave database configuration. How simply can I make the SLAVE server, the primary MASTER server, in case of an unforeseen event/disruption of the originally MASTER server? Can this been done with a simple mouse click or what?
    To zoom deeper in this matter, let's assume in this example the originally MASTER server became corrupted for unknown reasons and the SLAVE server has to take over. What has to be done? Due the fact their are two DNS server configured I need to point all sites to the up-and-running SLAVE server which will act as the MASTER server, since the originally MASTER server is down. And so I assume more configurations need to be applied. What is/can be automated to support this switch?

    Only writing this down gives IMHO a picture how cumbersome this is to change from an SLAVE server to a MASTER server. So I'd suppose their is a better and more efficient way, right? Also while following the tutorial in every step, doesn't talk about High Availability, Fail Over, switching MASTER to SLAVE and or Disaster Recovery. So hopefully someone can enlighten me about these aspects.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    A slave system can never become the master. The slave system always stays the slave server, but it provides the services like websites, databases, mail accounts etc. while master is down, so your customers have no service interruption when you redirect their website and mail traffic to it.
     
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Back up your master so you can restore the system if something goes south.
    The tutorial describes how to set up a reliable setup without knowing too much about HAProxy and other software like that. For most uses, and especially for inexperienced users, I would strongly recommend working with one webserver. You can have good uptime without the hassle of maintaining a (over) complicated setup. Downtime can be longer with such mirrored systems because of overcomplication.
     
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    One more note: You can set up a "local" network with most providers for your VPS systems.
     

Share This Page