Perlbal - Perlbal on EC2

This is Interesting: Free IT Magazines  
Home > Archive > Perlbal > August 2007 > Perlbal on EC2





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Perlbal on EC2
David Cancel

2007-08-07, 1:11 pm

I'm trying to use Perlbal to load balance a cluster of web servers hosted on
Amazon's EC2. EC2 does not provide access to IP Addreses, only hostnames.

Is there a way to pool servers using hostnames instead of IP addresses?

e.g.

This:
POOL my_web ADD
ec2-xx-xx-xx-xxx.z-1.compute-1.amazonaws.com:80<http://ec2-xx-xx-xx-xxx.z-1.compute-1.amazonaws.com/>
vs:
POOL my_web ADD 10.1.1.111:80 <http://10.1.1.111/>

Thanks,
David

David Snopek

2007-08-07, 1:11 pm

EC2 *does* provide access to IP addresses. Here's how I do it:

(1) On startup, the machine figures out its IP by grabbing the document at:

http://169.254.169.254/1.0/meta-data/local-ipv4

(2) Then it calls a service on the proxy host, passing the IP address
found in the step above, and it appends it to the nodefile used by
Perlbal.

If you don't want to do this from the machine itself (although I
highly suggest it because then you can make sure that your webserver
is up and running before it makes the call to add itself to the pool)
then just resolve the hostname via DNS.

On 8/7/07, David Cancel <dcancel@gmail.com> wrote:
> I'm trying to use Perlbal to load balance a cluster of web servers hosted on
> Amazon's EC2. EC2 does not provide access to IP Addreses, only hostnames.
>
> Is there a way to pool servers using hostnames instead of IP addresses?
>
> e.g.
>
> This:
> POOL my_web ADD
> ec2-xx-xx-xx-xxx.z-1.compute-1.amazonaws.com:80
> vs:
> POOL my_web ADD 10.1.1.111:80
>
> Thanks,
> David


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com