A user has configured ELB with two EBS backed instances. The user has stopped the instances
for 1 week to save costs. The user restarts the instances after 1 week. Which of the below
mentioned statements will help the user to understand the ELB and instance registration better?
A.
There is no way to register the stopped instances with ELB
B.
The user cannot stop the instances if they are registered with ELB
C.
If the instances have the same Elastic IP assigned after reboot they will be registered with ELB
D.
The instances will automatically get registered with ELB
Explanation:
Elastic Load Balancing registers the user’s load balancer with his EC2 instance using the
associated IP
address. When the instances are stopped and started back they will have a different IP address.
Thus, they will not get registered with ELB unless the user manually registers them. If the
instances are assigned the same Elastic IP after reboot they will automatically get registered with
ELB.
If your load balancer is attached to an Auto Scaling group, instances in the group are automatically registered with the load balancer. If you detach a load balancer from your Auto Scaling group, the instances in the group are deregistered.
Elastic Load Balancing registers your EC2 instance with your load balancer using its IP address.
[EC2-VPC] When you register an instance with an elastic network interface (ENI) attached, the load balancer routes requests to the primary IP address of the primary interface (eth0) of the instance.
Ans is C
C
The answer is D.
Answer C is related to the EIP which is a public address and related to assigning a public address to your instance. The ELB will route based on the eni of eth0, when you run ifconfig eth0 on a linux instance, you will see that the IP is not the public IP but the private IP.
When you register instances behind an ELB, health checks will route to instances once they are marked as healthy. Once the health check passes, the traffic will automatically route to the instance.