Reputation: 8888
I am configuring ELB with EC2 in AWS and run into "Instance has failed at least the UnhealthyThreshold number of health checks consecutively" error to cause the instance out of service. I have checked,
1) as I m using 8080 for security check port and my path is "/index.html". I test the link http://ec2DNSname:8080/index.html
in the browser, it returns,
Response header:
HTTP/1.1 200 OK
X-Powered-By: Express
Accept-Ranges: bytes
ETag: "150-1420697739000"
Date: Thu, 08 Jan 2015 06:16:21 GMT
Cache-Control: public, max-age=0
Last-Modified: Thu, 08 Jan 2015 06:15:39 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 150
Vary: Accept-Encoding
Connection: keep-alive
2) In my EC2 config, I allow the the inbound TCP traffic on 8080 from any machines
Any other possible cause of failing the health check?
Thanks Hammer
Upvotes: 5
Views: 17369
Reputation: 151
if u create a linux server then you only need to attache one index.html file to your server,then it will work with http as well as TCP. please let me it works or not. or you check Troubleshoot a Classic Load Balancer: Health Checks (1st error).
Upvotes: 0
Reputation: 270294
As long as the page returns a 200 response, it should eventually pass the health check. The Health Check configuration includes the number of times a Health Check needs to return a good result and how often to check it. So, a Healthy count of 5 with a check every 30 seconds would take 2.5 minutes to return as Healthy.
If the HTTP health check is failing, try it with a TCP health check on port 8080.
Also, just in case, check that your VPC configuration allows a connection from the Load Balancer to the EC2 instance. This will be automatic if they are in the same Subnet, but Network ACLs can impact a connection between different Subnets.
Upvotes: 4