I am a student in IT and I have been asked to build a web server cluster for multiple websites. After 2 weeks of searching, reading and testing, I came here to ask for help.
What we want is a cluster of web servers working together in load balancing and fail over.
What I have as running test setup now:
2 piranha servers in fail over and load balancing over 3 web servers each (nginx/php5).
The problems I encountered:
- Sessions are not synced. I have tried combining memcache, memcached & repcached, I failed to make php save it's sessions inside memcache
- No ideas about syncing data over 3 (or even more) web servers. I have setup DRBD it works for 2 servers but never found out how to for 4 servers.
What I have tried before:
- 2 nginx servers with a round-robin upstream to each 3 web servers load balancing
The 2 main servers get a high load on high activity
Sessions are not synced, every server-switch needs a new log in
If one of the 3 servers do not answer it will stop switching to the next server
- DRBD as data sync between the web servers
- Can't get DRBD working on 4 servers
To explain what my real questions are, we want to build a high available and fast web cluster. The web cluster should have all data synchronized realtime. I have no idea how to accomplish this! On this web cluster will run lots of websites, this means it should all be automatic and the users (websites) will not know this is on more than one server but will think it is one really big powerfull server.
How does google or facebook do this?
I do have thought about having a separate server on which the customer can edit the web server live, the real server will not be edited until they push their website to the web cluster. This could be done by rsync, but this doesn't seem to be a good solution.. the sessions could be on a shared storage, I think?
Any idea's or solutions are welcome!