Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Error : None of these Availability Zones contains a healthy target. Requests are being routed to all targets. in AWS

I have created a Application Load Balance in Aws. I have created 2 EC2 and make them a group. After that I add that group to the ALB with listener 80.

But when the system goes for healthy checks, it gives the error and shows that two registered EC2 are unhealthy.

The error is :

None of these Availability Zones contains a healthy target. Requests are being routed to all targets.

Availability Zones: subnet-5691df0f - ap-northeast-1c, subnet-97ae35e1 - ap-northeast-1a

Please let me know the reason.

AWS Related image

AWS Related image2

like image 497
Rashed Avatar asked Feb 07 '17 09:02

Rashed


2 Answers

I was running into this issue, and also getting a 504 Gateway timeout, and it ended up being this missing rule from the documentation.

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the left navigation, choose Security Groups.

  3. Choose the security group that your container instances use. If you created your container instances by using the Amazon ECS first run wizard, this security group may have the description, ECS Allowed Ports.

  4. Choose the Inbound tab, and then choose Edit.

  5. For Type, choose All traffic.

  6. For Source, choose Custom, and then type the name of your Application Load Balancer security group that you created in Configure Security Groups. This rule allows all traffic from your Application Load Balancer to reach the containers in your tasks that are registered with your load balancer.

  7. Choose Save to finish.

like image 70
david affinito Avatar answered Nov 16 '22 01:11

david affinito


I encountered a similar issue while learning to setup load balancer for my EC2 instance.

It turns out that under Target Groups:

the "path" under the "Health Check" tab was not registered although it showed the correct value "/".

Therefore I just edited the path value(by clicking the "edit health check") to "/" and saved it again just so that the system can register that value. (you could also try saving it to some other value, say "/health", first and then saving it back to "/")

This seemed to fix my problem.

like image 40
supi Avatar answered Nov 16 '22 01:11

supi