Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS EC2 instances are "Out of Service" after getting registered with ELB

I am facing a problem in AWS. I am creating and registering an instance with an ELB. Though it is getting registered, it is not passing through the health check and showing Out-of-Service. The error reason is "Instance has failed at least the Unhealthy Threshold number of health checks consecutively".

My health check values are as follows:

Ping Target: TCP:80
Timeout: 10 seconds
Interval: 24 seconds
Unhealthy Threshold: 6
Healthy Threshold: 10

Appreciate your help.

Thanks,

Chandan

like image 362
Chandan Patra Avatar asked Dec 16 '22 03:12

Chandan Patra


2 Answers

Is your instance behind the ELB running a web server ? If it is does it return an '200' (OK) ? If not then that's your problem.

If you are running a web service that returns a 200, is your security group open to the ELB? Meaning the ELB's source security group has to allowed into your instance's security group.

like image 76
Rico Avatar answered Jan 17 '23 13:01

Rico


Make sure you application is running and not throwing any exception. In my case, it was node application
1. right click on 'EC2 > Load Balancer > ' and select on 'Edit health check'
2. change the protocol from https to tcp
3. Click on instance tab and status was inService

like image 40
Sandy Avatar answered Jan 17 '23 12:01

Sandy