We have an existing dedicated server running LAMP (Ubuntu 14.04.3 LTS & Webmin/Virtualmin) which serves CMS/PHP websites, client portals, email and mysql etc.
We have 1 spare dedicated serve which is the same hardware and has Ubuntu 16.04.1 installed but is currently blank and unused.
We're looking for a solution so that when Server 1 (the dedicated server already in use) needs maintenance, updates or if it fails then the second spare server detects this and takes over and serves the websites and other services.
When Server 1 is then back online, Server 2 would then detect its presence again and sync any updates, file changes/emails or websites changes back to Server 1 again and then switch back so that Server 1 is serving the content again.
We only have these two server available for this and no other hardware. The other problem is that we don't think we can use block level mirroring/DRDB or similar due to not having the right partitions setup already on the server in use.
We're open to ideas and solutions on this but just need a simple and cheap solution that is reliable and won't corrupt or lose any data.
We've already found a couple of potential guides to Heartbeat, corosync, pacemaker and keepalived but are unsure how to best use them and set them up without causing too much downtime on the active Server 1.
This guide also mentions using rsync and looks reasonable and fairly simple but misses a couple of the requirements needed and also we're unsure if it is the best solution being a 6 year old post:
We'd also need details of what is implemented and how to make sure it can be recreated in future if we add further servers or if we have a problem and need to reconfigure things.
Thanks for any options on this.