2 nginx webservers, mariadb on both for wordpress, HA setup what to use?

Discussion in 'Installation/Configuration' started by joe Bifano, Jul 3, 2022.

  1. joe Bifano

    joe Bifano New Member

    I have 2 nginx web servers on Ubuntu20.4 serving WordPress sites that use MariaDB for the databases.
    What is the best setup for High Availability?
    I have seen this post ...
    how-to-set-up-nginx-high-availability-with-pacemaker-corosync-and-crmsh-on-ubuntu-1604
    I think this takes care of the Nginx side?
    Then this post...
    tutorial/ubuntu-drbd-heartbeat-high-availability
    It will do the Mariadb HA.
    Would I just do both setups to get the desired results? Or would I change something in one or the other maybe combine things?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    What criteria is used for evaluating bestness?
     
  3. joe Bifano

    joe Bifano New Member

    Okay lets forget best
     
  4. joe Bifano

    joe Bifano New Member

    well I tried the first link and had a lot of errors and could get that to work so I am looking for another solution and help would be great!!
     
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    You'd need a highly available storage cluster for the web data and a master-master replicated MariaDB setup.
     
  6. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    you may also need a shared redis/memcache server for session data, or configure wordpress to store session data in the db or shared file system.
    alternatively use something in front of them like haproxy for load-balancing, with sticky sessions, so new requests from the same source ip go to the same backend web server each time.
    you'd also have to sort out getting the certs onto both webservers ( if not using haproxy/load-balancer, or if using haproxy/load-balancer as a passthru). or terminate ssh sessions on haproxy/load-balancer, ie website certs are on haproxy/load-balancer.
    the connection between haproxy / load-balancer and the webservers are then either http only, or start a new https connection from haproxy / load-balancer to the webservers.
     
  7. joe Bifano

    joe Bifano New Member

    So if anybody wants to know where I am at with this so far here is what I have done.
    1. I have 2 PFsense router boxes using carp so if one goes down the other is there as a backup with a second IP from WAN.
    2. I have 2 Ubuntu web servers with Ubuntu, Nginx and wordpress using rsync or Unison and looking at another one to keep the servers in sync.
    3. I have the Pfsense routers setup with HAproxy with sticky sessions serving the 2 web servers so if one server goes down the other is available.
    4. I have 2 Maria database servers using there replication system so they stay in sync.
    5. I have certs on PFsense boxes.
    6. I am hoping to have wordpress store the session data in the database.
    If there is anything anyone sees that I need to change or add please let me know.
    So far it looks like this will work.
     

Share This Page