A company is hosting a specialized IoT data receiver application on Amazon EC2 instances within an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The application receives data streams on port 5001, but the application's internal diagnostics and health status endpoint runs on port 8081. After launching the instances, the ALB target group reports all EC2 instances as unhealthy, and no traffic is forwarded to them, even though local logs show the application is running normally. Which of the following configuration changes will resolve this issue?
- Modify the Application Load Balancer target group's health check configuration to override the port and specify port 8081.Answer
- BUpdate the Application Load Balancer listener rule to forward incoming traffic to port 8081, and set the target group's health check port to 'traffic-port'.
- CAdd an inbound rule to the security group associated with the EC2 instances to allow port 8081, and configure the subnet's Network ACL with an inbound rule for port 8081 without adding a corresponding outbound rule.
- DConfigure Amazon Route 53 latency routing to distribute traffic directly to the Auto Scaling group instances' public IP addresses, relying on Route 53 to failover during unhealthy states.
Answer
Modify the Application Load Balancer target group's health check configuration to override the port and specify port 8081.
The correct solution is to modify the Application Load Balancer target group's health check configuration to override the port and specify port 8081. By default, target groups perform health checks on the port where they receive traffic (the 'traffic-port', which is port 5001). Since the application's health endpoint is hosted on port 8081, the health check requests sent to port 5001 fail, marking the instances as unhealthy. Overriding the health check port to 8081 allows the Application Load Balancer to query the correct endpoint while client traffic is successfully routed to port 5001.
Step-by-Step Solution
Key Concept
Configuring custom health check ports in Elastic Load Balancing target groups to align with application-specific health endpoints.
Estimated Time:2m 0s