Upendra
Upendra

Reputation: 703

Why Elastic load balancer states "out of service", when I added all instances

I created a Elastic load balancer in my virtual private cloud.

I had added all my existing instances to Elastic load balancer, it shows "out of service" message with a hint "Instance has failed at least the UnhealthyThreshold number of health checks consecutively."

Upvotes: 1

Views: 6337

Answers (2)

Upendra
Upendra

Reputation: 703

first need to test our health check log in server.

steps

  1. connect to our server using SSH
  2. run this command "tail -f /var/log/apache2/access.log", then you will get response code.(200 - OK, 302 - Redirecting).
  3. Response code other than 200, means health check fails.
  4. In my case I found that the response code was 302, it means that is redirecting issue.
  5. Just I ran my url in browser, it redirecting to x.com/login
  6. For that I need to change my ping path in Load balancer, just I opened my loadbalancer,and changed my ping path from '/' to '/login', then automatically my response changed from 302 to 200. and my instance is "In Service".

Upvotes: 4

E.J. Brennan
E.J. Brennan

Reputation: 46859

Here is the list of typical reasons this might happen: Good place to start:

http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ts-elb-healthcheck.html

Problem: Instance(s) closing the connection to the load balancer.

Cause: Elastic Load Balancing terminates a connection if it is idle for more than 60 seconds. The idle connection is established when there is no read or write event taking place on both the sides of the load balancer (client to load balancer and load balancer to the back-end instance).

Solution: Set the timeout settings on your registered instances to at least 60 seconds.

Problem: Responses timing out.

Cause: When the load balancer performs a health check, the instance may be under significant load and may take longer than your configured timeout interval to respond.

Solution: Try adjusting the timeout on your health check settings.

Problem: Non-200 response received.

Cause: When the load balancer performs an HTTP/HTTPS health check, the instance must return a 200 HTTP code. Any other response code will be considered a failed health check.

Solution: Search your application logs for responses sent to the health check requests.

Problem: Failing public key authentication.

Cause: If you are using an HTTPS or SSL load balancer with back-end authentication enabled, the public key authentication will fail if the public key on the certificate does not match the public key configured on the load balancer.

Solution: Check if your SSL certificate needs to be updated. If your SSL certificate is current, try re-installing the certificate on your load balancer.

Upvotes: 0

Related Questions