Auto Scaling & ELB
Auto Scaling & ELB makes it easy to route traffic through a dynamically changing fleet EC2 instances
acts as a single point for all traffic to an Auto Scaling group instances.
Auto Scaling dynamically adds or removes EC2 instances. Elastic Load Balancing manages incoming request by routing traffic optimally so that no instance is overwhelmed
Auto Scaling allows you to automatically increase the number EC2 instances if user demand is high, and decrease the number EC2 instances if demand is lower
ELB service distributes the incoming web traffic (called load) automatically among all running EC2 instances
ELB uses loadbalancers to monitor traffic and respond to requests sent through the Internet.
ELB &Auto Scaling make it easy to route traffic through a dynamically changing fleet EC2 instances.
Load balancer acts as a single point for all traffic to an Auto Scaling group.
Attaching/Detaching ELBs with Auto Scaling Group
Auto Scaling works with Elastic Load Balancing, and allows you to attach one or more load balancing devices to an existing Auto Scaling group.
ELB registers the EC2 instance using its IP address, and routes requests to the primary address (eth0), of the instance.
Once the ELB has been attached, it registers the instances within the group and distributes any incoming traffic across them
ELB can be detached and enters the Removing State while deregistering instances within the group.
If connection draining has been enabled, ELB will wait for in-flight requests complete before deregistering the instances.
After being deregistered by the ELB, instances continue to run
Auto Scaling adds instances as they are launched to the ELB, but this can be stopped. High Availability and Redundancy
Auto Scaling can be used in multiple AZs within the same area.
Auto Scaling creates new instances in unaffected AZs when one AZ becomes sick or unavailable.
Auto Scaling redistributes traffic across all AZ when the unhealthy AZ is recovering.
An elastic load balancer can be used to distribute incoming requests across EC2 instances within a single AZ, or multiple AZs within a given region.
Auto Scaling and ELB can be used to take advantage of the safety, reliability and reliability of geographic redundancy by distributing Auto Scaling groups across multiple regions and then setting up ELB for traffic distribution across those AZs.
Health Checks
Auto Scaling group checks the results of EC2 instance status checks periodically to determine the health state of each instance.
If the instance fails to pass the EC2 status check, Auto Scaling marks it as unhealthy and replaces it with a healthy one.
ELB also conducts health checks on EC2 instances registered with it for e.g. You can access the application by pinging the health check page
To ensure that traffic is only routed to healthy instances, an ELB health check should be performed with the instances.
If the ELB health check fails, auto scaling will not replace the instance.
Monitoring
CloudWatch receives data from Elastic Load Balancing about load balancers and instances of EC2. CloudWatch gathers data about your resources and presents it to you as metrics.
After registering one load balancer with the Auto Scaling Group, the Auto Scaling Group can be configured to use ELB metrics such as reque
