EC2 auto scaling instances failing health check in target groups

0

I created two public subnets in two availability zones and added an internet gateway and configured route tables to accept traffic from anywhere. Now, I launched an ec2 instance(public IP enabled) in public subnet of one availability zone and added a security group to accept HTTP and HTTPS traffic from anywhere. Now, I created an Application load balancer(internet facing) configured to the same VPC as of above subnets residing in and added two availability zones.Now, in the target groups I added current ec2 instance to it. Now, I created a ec2 template from the ec2 instance configuration and enabled it to autoscaling group. Now, I created an auto scaling group, I configured two public subnets and the launch template I created.

problem: auto scaling group is launching instances but target groups is failing health checks for these instances

3 Answers
0
Accepted Answer

Or you could follow this walk-through to find out what was the step you missed. https://docs.aws.amazon.com/autoscaling/ec2/userguide/tutorial-ec2-auto-scaling-load-balancer.html

If you added some manually created instances to target groups and those are working fine vs auto scaling instances failing the status check, it could be that have manually started your webserver, or done some other changes that are not included in the AMI, so instances created from launch template are different from ones you created manually?

profile picture
EXPERT
Kallu
answered a year ago
profile picture
EXPERT
reviewed a year ago
0

Hi. This article will help you.

https://repost.aws/knowledge-center/elb-fix-failing-health-checks-alb

Assuming your launch template doesn't have problem, check the following, in particular.

  • ELB health check path
  • 2 Public subnets route table and network acl(if configured)
profile picture
EXPERT
answered a year ago
profile picture
EXPERT
reviewed a year ago
0

https://docs.aws.amazon.com/autoscaling/ec2/userguide/ts-as-healthchecks.html

EC2 instance status check failure: If there are issues that cause Amazon EC2 to consider the instances in your Auto Scaling group impaired, Amazon EC2 Auto Scaling automatically replaces the impaired instances as part of its health check. To address this issue, you can manually create an Amazon EC2 instance that is not part of the Auto Scaling group and investigate the problem. After you confirm that your instance launched successfully and is healthy, deploy a new, error-free instance configuration to the Auto Scaling group​.

EC2 scheduled reboot: Auto Scaling instances are replaced when a scheduled event indicates a problem with the instance. If you do not want instances to be replaced due to a scheduled event, you can suspend the health check process for an Auto Scaling group​.

EC2 health check indicating that the instance has been terminated or stopped: Auto Scaling instances that have been stopped, rebooted, or terminated are replaced. If a health check fails because a user manually stopped, rebooted, or terminated the instance, this is due to how Amazon EC2 Auto Scaling health checks work. The instance must be healthy and reachable. If you need to reboot the instances in your Auto Scaling group, AWS recommends that you put the instances on standby first​.

ELB system health check failure: Auto Scaling instances might pass the EC2 status checks, but they might fail the Elastic Load Balancing health checks for the target groups or Classic Load Balancers with which the Auto Scaling group is registered. An instance might fail the Elastic Load Balancing health check because an application running on the instance has issues that cause the load balancer to consider the instance out of service. To pass the Elastic Load Balancing health checks, you should verify several settings, including the success codes that the load balancer is expecting, the security groups for your load balancer and Auto Scaling group, and the health check settings of your target groups​.

It's also worth mentioning that you can be notified when Amazon EC2 Auto Scaling terminates the instances in your Auto Scaling group, including when the cause of instance termination is not the result of a scaling activity. For more information, see the Get Amazon SNS notifications (https://docs.aws.amazon.com/autoscaling/ec2/userguide/GettingStartedTutorial.html#gs-lc-hook) when your Auto Scaling group scales guide on AWS' official documentation.

profile picture
EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions