Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS:ELB health is failing or not available for all instances

Our ELB is intermittently failing health checks on instances and throws errors "Environment health has transitioned from Ok to Warning. 2 out of 2 instances are impacted. See instance health for details" and after a minute it throws "Environment health has transitioned from Warning to Severe. ELB health is failing or not available for all instances"

It happens everyday on same time. Also I suspect that it happens whenever our CRON runs but I am not sure as it doesn't happens on other ELB instances.

I would like to know the root cause of this kind of problem as I searched through the forum and everyone had some different situations and cannot figure out what problem it would be for us.

This is our Production instance.

like image 481
Imran Sheikh Avatar asked May 07 '18 10:05

Imran Sheikh


People also ask

What ELB will do if one of the instances fails health check?

Health check failed The instance will continue being monitored and if it starts failing health checks, the ELB will respond by marking it as unhealthy, stop routing traffic to it, and wait for the ASG to replace it.

Why is ELB health check failing?

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 an EC2 instances behind an ELB fails a 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.

What if ELB fails in AWS?

But in such situations, there are three possible ways to get out of it: Wait for AWS to restore service. Route traffic directly to instance public IPs or elastic IPs if available. Move your app and traffic to a different region or different provider.


1 Answers

Application load balancer(a part of ELB) looking default "/" endpoint for health check and ELB gets 404 status code so ElasticBeanstalk instances turn red. You should create an endpoint for health check and send 200 status code. İf you want to use another path you should modify load balancer for example: "default 80 HTTP /" to "default 80 HTTP /healthCheck"

like image 140
Gökhan Ayhan Avatar answered Sep 20 '22 09:09

Gökhan Ayhan