Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single domain on multiple servers

I have a domain that needs spread on several server for load balancing purposes. I also have my application to tell what server suppose to handle certain requests.

Right ow I have it set to use sub-domains like www1, www2 and just redirect to each server but that is ugly.

I need a way to proxy the requests and users to see only www all the time regardless what IP is actually serving the request...

I read a bit into apache proxy thing, but I am still confused how will such a scenario deliver the page and resources like videos without changing the www.

like image 632
Cristian Rusu Avatar asked Sep 24 '12 06:09

Cristian Rusu


1 Answers

You can enter multiple ip addresses per subdomain in your DNS table. If your DNS server supports it, you can rotate these entries on each request to get a simple round robin load balancer (see http://en.wikipedia.org/wiki/Round-robin_DNS)

However, a much better solution is to have a load balancing server that handles all request to your web site. This way you can add and remove web servers to/from load balance instantaneously. So when you need to do some maintenance on one server you just take it out of the rotation.

Many load balancers also check if the web servers are still alive and remove dead servers automatically. This will increase your uptime significantly.

like image 192
Clemens Helm Avatar answered Sep 28 '22 11:09

Clemens Helm