High availability LAMP servers for legacy app

Hi! I have a customer that uses a home-made website/system for invoicing, that runs on a legacy LAMP stack (PHP 5.6, MySQL 5.0, Apache 2.4 & CentOS 7). I can’t upgrade PHP nor MySQL, since his code does not work on newer versions (yes, i know [sigh]).

Right now, we have this site/system running on a VPS on Afterburst, with 4 vCPU, 6GB RAM, 258G HDD and it’s working alright. The problem is when there’s some problem in the datacenter (the container host fails, connectivity/network problems, etc.): my customer’s site/system stops working, and his customers can’t work either (since they can’t generate invoices while the VPS is down) so my customer is asking for a redundant but VERY economic service (yes, again, I know… they want it cheap AND robust…)

My first idea was to keep this VPS as is, and hire/rent another VPS with a similar configuration, on ANOTHER datacenter (in case the primary datacenter catches fire, like OVS knows), copy their site entirely to the second server, and put MySQL on a “master-slave” configuration (the original server as the “master” and the secondary server as a “slave”). Then I’d use a DNS Fail Over, so when the master server goes down, the DNS will point his domain to the “slave” server and they can continue working.

That’s the cheapest solution that I thought (they only have to pay the extra server and the failover-DNS), but I see a big problem: If the main (master) server fails amidst a transaction… that transaction will NOT replicate to the secondary (slave) server, and then the database on the slave server can get corrupt… Also, it has another problem: after the main server gets operative again, I’d have to manually move the databases from the “secondary” server to the primary.

I also thought about using 3 VPS: 2 to run the PHP code, and a 3rd VPS to run MySQL and the database… but then I’d have a single-point risk again: if the MySQL VPS goes down, they can’t continue working…

Any other solution you can suggest, that is safe, reliable and cheap, but still be compatible with their legacy app/stack?

submitted by /u/BarajasFernando
[link] [comments]

Go to Source of this post
Author Of this post: /u/BarajasFernando
Title Of post: High availability LAMP servers for legacy app
Author Link: {authorlink}