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?
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!!
You'd need a highly available storage cluster for the web data and a master-master replicated MariaDB setup.
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.
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.