Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

load balancing

hi guys,
i have two linux boxes in differnet locations, and i wanted to know if i can somehow do load balacing on the two so that people would hit a different box at a time,, like lets say if one box is in california and one in florida, if someone in california wants to get a file, it would hit the box in california and if someone in florida wants a file, it would hit the box in florida, is this possible?
thanks
0
djsoltan
Asked:
djsoltan
1 Solution
 
pablouruguayCommented:
0
 
kblack05Commented:
DNS Round-Robin
The simplest method for load-balancing is to use the DNS round-robin feature of BIND. Here you just configure www[0-9].foo.com as usual in your DNS with A(address) records, e.g.

www0   IN  A       1.2.3.1
www1   IN  A       1.2.3.2
www2   IN  A       1.2.3.3
www3   IN  A       1.2.3.4
www4   IN  A       1.2.3.5
www5   IN  A       1.2.3.6
 

Then you additionally add the following entry:

www    IN  CNAME   www0.foo.com.
       IN  CNAME   www1.foo.com.
       IN  CNAME   www2.foo.com.
       IN  CNAME   www3.foo.com.
       IN  CNAME   www4.foo.com.
       IN  CNAME   www5.foo.com.
       IN  CNAME   www6.foo.com.
 

Notice that this seems wrong, but is actually an intended feature of BIND and can be used in this way. However, now when www.foo.com gets resolved, BIND gives out www0-www6 - but in a slightly permutated/rotated order every time. This way the clients are spread over the various servers. But notice that this not a perfect load balancing scheme, because DNS resolve information gets cached by the other nameservers on the net, so once a client has resolved www.foo.com to a particular wwwN.foo.com, all subsequent requests also go to this particular name wwwN.foo.com. But the final result is ok, because the total sum of the requests are really spread over the various webservers.

DNS Load-Balancing
A sophisticated DNS-based method for load-balancing is to use the program lbnamed which is a Perl 5 program in conjunction with auxilliary tools which provides a real load-balancing for DNS. http://www.stanford.edu/~riepel/lbnamed/

0
 
djsoltanAuthor Commented:
thanks for the help,
is there an easier way to do this? i remember theplanet used to offer a software that would do load balancing for you if u had two of their servers, is there a software i can get to do this other than the ilbnamed u mentioned?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
kblack05Commented:
If you have a third Apache server, you can configure a round robin behind it with mod_rewrite, and some server side modifications.

Your third box would run a script to round robin hosts behind it. DNS would point only to that server and it would hand off.
0
 
pablouruguayCommented:
and my answer is not valid? you read-it cyclops?
0
 
Cyclops3590Commented:
I didn't believe it was.  pablouruguay, yours seemed to be instructions to get two internet linked mux'ed into one box, whereas that is not what the asker seemed to be going after since they stated in the original question:

"like lets say if one box is in california and one in florida,"

If I am wrong, please clarify why your suggestion was indeed valid.
0
 
pablouruguayCommented:
no its ok. dont worry
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now