I'm new to this type of setup but wanted to see if my thinking was somewhat sound or has major flaws.
I have a moodle installation that I am trying to have next to no downtime with and was thinking about using the following setup.
I have a VPS with the installation running great. I was thinking about getting a second VPS setup and syncing the two. I would setup mysql replication so that whatever happens on the primary would happen on the secondary. I would also setup an rsync job to copy over any files uploaded every 4-6 hours.
I would then have a failover DNS so that if the primary becomes unresponsive the DNS will automatically point to the secondary with the understanding that there might be a loss in some files if something was uploaded between the last rsync and when it went down.
Pro, cons, flaws? oh my god no!?
Another puzzle would be how to get the primary back up and running with the latest content but that would be a secondary issue.
If my above thinking is totally flawed, does anyone have any other solutions? I would be open to just about anything as it is imperative to have this site up and running 100%
Appreciate all feedback.