Has anyone done something similar in production for deploying an HA for a LAMP based website?

In the LAB, I setup two kvm web server’s. Both KVM guest OS are stored using a DRBD storage type.

On each kvm guest, I added a second hard drive same size for both. I then used the extra hard drive to create a DRBD block mounted as /home to hold web content shared by both web servers. To allow concurrent access to the web content and backend coming from either web server’s I added a distributed file system called ocfs2 on the drbd resource.

The Joomla MySQL database is stored on a separate KVM, accessed by both web server’s.

In front of the web servers I have another KVM vm running zenloadbalancer to divert web traffic in case one of the web servers die. Each web server is using a different WAN link.

The failover works without any noticeable downtime but I still have to load test both web servers to simulate real traffic. The other thing I still need to do is have pacemaker handle the auto mount of the drbd resource drive once I figure out the documentation. Currently when I reboot the web servers there is an issue where apache2 fails to start during boot up because the drbd resource mounted on /home is not available yet. To get around this I currently use the webmin module “system and server status” to monitor apache then have it start apache2.