I created a load balancer and assigned it one of the running EC2 instance. After creation, I navigated to Target Group section in the AWS Console under Load Balancing and when I selected the target group that was assigned to the load balancer, it shows registered instance status as "Unhealthy" and there was a message above registered instance pane that says "None of these Availability Zones contains a healthy target. Requests are being routed to all targets". While creating the load balancer, I selected all the subnets (availability zones). settings I used for health check are mentioned below,
So why does my registered instance status as "Unhealthy" and how can I rectify/resolve that to change the status to "In-service"?
When the load balancer determines that an instance is unhealthy, it stops routing requests to that instance. The load balancer resumes routing requests to the instance when it has been restored to a healthy state.
On the Amazon EC2 console navigation pane, under Auto Scaling, choose Auto Scaling Groups, and then select the instance's group. Choose the Details view and note the Health Check Type. Choose Edit and select ELB for Health Check Type, and then choose Save.
9: What happens when an EC2 instance that is being served traffic from an ELB becomes unhealthy? The ELB will stop serving traffic to it and divert it's traffic to a healthy instance – as this is all it can do. It is Auto Scaling which can take an unhealthy instance, terminate it, and replace it with a new instance.
Unhealthy indicates that the health check is failing for the instance.
Things to check:
healthcheck.html
responds with a valid 200 responseIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With