I found out that my ami had to register itself automatically with the load balancer.
Basically, I found a web site that would tell me my public ip address, did a curl -s on this web site to get the response back, pipe that into grep and save that to a file. i do the same thing with ifconfig (the first the that comes back should be the private ip of the ami). i load these as strings into my program and do a wget on the address to register with the load balancer. my lines in my program look something like this:
os.system("curl -s http://www.ipaddress.org | egrep -m1 -o \'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\' > /tmp/publicip.out")
then i load in the first line of /tmp/publicip.out into a variable in the program, concat that onto the end of a string and wget the loadbalancer url with that.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment