Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Elastic Load Balancing report 'Out of Service'?

I am trying to set up Elastic Load Balancing (ELB) in AWS to split the requests between multiple instances. I have created several images of my webserver based on the same AMI, and I am able to ssh into each individually and access the site via each distinct public DNS.

I have added each of my instances to the load balancer, but they all come back with the Status: Out of Service because they failed the health check. I'm mostly confused because I can access each instance from its public DNS, but I get a timeout whenever I visit the load balancer DNS name.

I've been trying to read through all the docs and googling it, but I'm stuck. Any pointers or links in the right direction would be greatly appreciated.

like image 233
jkeesh Avatar asked Aug 18 '11 14:08

jkeesh


People also ask

Why instance is out of service in load balancer?

An instance might fail the ELB health check because an application running on the instance has issues that cause the load balancer to consider the instance out of service.

What happens when elastic load balancer fails?

If one load balancer fails, the secondary picks up the failure and becomes active. They have a heartbeat link between them that monitors status. If all load balancers fail (or are accidentally misconfigured), servers down-stream are knocked offline until the problem is resolved, or you manually route around them.

What happens when the elastic Load Balancing fails the health check?

If an instance fails these status checks, it is marked unhealthy and is terminated while Amazon EC2 Auto Scaling launches a new replacement instance. You can attach one or more load balancer target groups, one or more Classic Load Balancers, or both to your Auto Scaling group.

Why is my load balancer not working?

If the load balancer is not responding to requests, check for the following issues: Your internet-facing load balancer is attached to a private subnet. You must specify public subnets for your load balancer. A public subnet has a route to the Internet Gateway for your virtual private cloud (VPC).


2 Answers

I contacted AWS support about this same issue. Apparently their system doesn't know how to handle cases were all of the instances behind the ELB are stopped for an extended amount of time. AWS support can manually refresh the statuses, if you need them up immediately.

The suggested fix it to de-register the ec2 instances from the ELB instead of just stopping them and re-register them when you start again.

like image 54
batman 74 Avatar answered Sep 22 '22 23:09

batman 74


Health check is (by default) made by accessing index.html on each instance incorporated in load balancer. If you don't have index.html in document root of instance - default health check will fail. You can set custom protocol, port and path for health check when creating elastic load balancer.

like image 24
ivankoni Avatar answered Sep 21 '22 23:09

ivankoni