How to build a redundant Webserver cluster based on the following requirements ?
- Two Ubuntu Server 12.04 LTS Active-Active nodes (really load-balanced; not round robin).
- Apache web server
- site content on a shared storage (or mirrored and synced on both servers)
Detailed steps would be highly appreciated.
Such setup is depending on the kind of content to be accessed via the web : strictly static, dynamic (PHP, ...), coming from an application server (tomcat, Jboss, ...)
For the load-balancing part, it is important to know if you need a cluster load-balancer (to avoid single point of failure at this level too), persistance of sessions, if you have ressources to put the load-balancer(s) outside the web servers.
You don't explain how you generate the content for your web server. If the content is generated once a while on an external device, it may not be necessary to have a shared storage or replicated storage for them. Just by pushing the new content to two servers instead of one from the machine where the developments occurs would suffice.
A compact approach would be to install Linux Virtual Server on both web servers, along with apache.
If the site is doing modification in the file system of the Apache document root, there can be numerous solutions, depending of your application :
- Just perform rsync at regular interval between both server using crontab
- Create an NFS share on a third server mounted as the document root of both Apache
- If the content change a lot and you don't want to loose anything anytime, you can create a filesytem on a DRDB configuration, to do synchrone replication at block level of your document root.
- Build a redundant shared storage box combining DRBD and a sharing mechanism (NFS = sharing at file level, iSCSI = sharing at block level). The choice of the method of sharing greatly depend of your application (number of parallel connections, amount of I/O, ...)
In conclucion, it is not easy to be detailed and exhaustive to answer your question as your input is too vague. The correct solution must be setup according to the requirements of the application which are not detailed here.