Out of Service & In Service – AWS EC2 Instances on AWS Elastic Loadbalancer

Please share it on

I’m having a personal website hosted at AWS EC2 with ELB. Today I have started my AWS EC2 instances (I had turned off due to non usage and Of course, I can save some cost) and tried to load my website via AWS Elastic loadbalancer public dns url but it was not coming up in my browser, instead of webpage I got a blank white page. So I checked my AWS EC2 instances and ELB services.

In the Elastic Load Balancer section, I can see that the status message is showing the registered AWS EC2 instances are “Out of Service”! I tried to change the health check parameter values, nothing happened! So I deregister the EC2 instances from the loadbalancer and register the same again. After few minutes the instances are coming up to “In Service”. It took sometime because the EC2 instances should register into the loadbalancer and health check. Finally I brought my website up.

The reason behind the problem

Elastic Load Balancing registers your load balancer with your EC2 instance using the associated IP address. When your EC2 instance launched in EC2-Classic is stopped and then started, the IP address associated with your instance changes. Your load balancer does not recognize the new IP address. When you stop and then start your registered EC2 instance launched in EC2-Classic, you must deregister your stopped instance from your load balancer, and then reregister the restarted instance. Failure to do so may prevent the load balancer from routing the traffic to the restarted instance.

If you have launched your instance in EC2-VPC, by default, the IP address associated with your instance does not change when you stop and then start the instance. However, when you stop and then start your EC2-VPC instance, your load balancer might take sometime to recognize that the stopped instance has started. During this time your load balancer is not connected to the restarted instance. I recommend that you reregister your restarted instance with the load balancer.

Please share it on

2 Comments for “Out of Service & In Service – AWS EC2 Instances on AWS Elastic Loadbalancer”

Brad Andriese

says:

I’m not sure how this blog entry is more helpful than what amazon themselves wrote:

“If you have launched your instance in EC2-VPC, by default, the IP address associated with your instance does not change when you stop and then start the instance. However, when you stop and then start your EC2-VPC instance, your load balancer might take sometime to recognize that the stopped instance has started. During this time your load balancer is not connected to the restarted instance. We recommend that you reregister your restarted instance with the load balancer. For information on reregistering your instance, see Registering Your Amazon EC2 Instances with Your Load Balancer.”

Source: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/US_DeReg_Reg_Instances.html

Leave a Reply

Your email address will not be published. Required fields are marked *