Note that there are some explanatory texts on larger screens.

plurals
  1. POAccessing AWS EC2 instances through ELB
    primarykey
    data
    text
    <p>I'm trying to set up two instances under an elastic load balancer, but cannot figure out how I'm supposed to access the instances through the load balancer.</p> <p>I've set up the instances with a security group to allow access from anywhere to certain ports. I can access the instances directly using their "Public DNS" (publicdns) host name and the port PORT:</p> <p>http://[publicdns]:PORT/</p> <p>The load balancer contains the two instances and they are both "In Service" and it's forwarding the port (PORT) onto the same port on the instances.</p> <p>However, if I request</p> <p>http://[dnsname]:PORT (where dnsname is the A Record listed for the ELB)</p> <p>it doesn't connect to the instance (connection times out).</p> <p>Is this not the correct way to use the load balancer, or do I need to do anything to allow access to the load balancer? The only mention of security groups in relation to the load balancer is to <em>restrict</em> access to the instances to the load balancer only, but I don't want that. I want to be able to access them individually as well.</p> <p>I'm sure there's something simple and silly that I've forgotten, not realised or done wrong :P</p> <p>Cheers, Svend.</p> <hr> <p>Extra info added:</p> <p>The Port Configuration for the Load Balancer looks like this (actually 3 ports):</p> <p>10060 (HTTP) forwarding to 10060 (HTTP) Stickiness: Disabled(edit)</p> <p>10061 (HTTP) forwarding to 10061 (HTTP) Stickiness: Disabled(edit)</p> <p>10062 (HTTP) forwarding to 10062 (HTTP) Stickiness: Disabled(edit)</p> <p>And it's using the standard/default elb security group (amazon-elb-sg).</p> <p>The instances have two security groups. One external looking like this:</p> <p>22 (SSH)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.0.0.0/0<br> 10060 - 10061 0.0.0.0/0<br> 10062 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.0.0.0/0<br></p> <p>and one internal, allowing anything within the internal group to communicate on all ports:</p> <p>0 - 65535 sg-xxxxxxxx (security group ID)</p> <p>Not sure it makes any difference, but the instances are m1.small types of image ami-31814f58.</p> <hr> <p>Something that might have relevance:</p> <p>My health check used to be HTTP:PORT/ but the load balancer kept saying that the instances were "Out of Service", even though I seem to get a 200 response on the request on that port.</p> <p>I then changed it to TCP:PORT and it then changed to say they were "In Service".</p> <p>Is there something very specific that should be returned for the HTTP one, or is it simply a HTTP 200 response that's required? ... and does the fact that it wasn't working hint towards why the load balancing itself wasn't working either?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COI tried this as well, using the web console: 1) Created a security group that allows all access from all sources. 2) Created new t1.micro instance, using the new security group. 3) SSH onto group and netcat "Hello" on port 80. 4) Check that I can get the "Hello" HTTP 200 response directly (yes) 5) Create load balancer and assign this instance. 6) Set health check as TCP:80 (HTTP:80/ doesn't work). 7) Try accessing load balancer. Not working. 8) Feel sad :(
      singulars
    2. COHow are you trying to access the loadbalancer. When I make my requests to the loadbalancer I'm requesting a file index.html. Its possible the loadbalancer doesn't like sending an empty file?
      singulars
    3. COI've been experimenting a bit, and it does seem that the issue is with my load balancers health check. Just getting a 200 response code doesn't seem to be enough. I achieved that before by using netcat (echo "Hello" | nc -l PORT), but that didn't work. Changing it to use TCP made it appear "In Service", but might not have worked. I just created a small instance, and as soon as I installed httpd and had it reply with a proper html file (http reply), it worked! :) Thank you all. On Monday I'll verify it is the problem (bwight, do you want to write it in answer form, so I can tick it if so :) )
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload