Search This Blog

Saturday, December 10, 2016

Part - 11 - AWS - AWS ELB (Elastic Load Balancer)

AWS ELB (Elastic Load Balancer)

The Elastic Load Balancer or ELB is a web service that allows you to automatically distribute incoming traffic cross a fleet of EC2 instances. In simpler terms, an ELB acts as a single point of contact between your clients and the EC2 instances that are servicing them. The clients query your application via the ELB; thus, you can easily add and remove the underlying EC2 instances without having to worry about any of the traffic routing or load distributions. It is all taken care of by the ELB itself!
Exam Topics:
·        In Service or Out of Service
·        Health Checks
·        Have their own DNS name. You are never given an IP address.
Second important thing worth mentioning is the ELB’s costs. Although it is free (Terms and Conditions apply) to use under the Free Tier eligibility, ELBs are charged approximately $0.025 per hour used. There is a nominal charge on the data transferring as well, which is approximately $0.008 per GB of data processed.
·        Detects unhealthy instances and directs load to only healthy ones
·        Can distribute load across availability zones
·        Paid-for service
·        Can be used with Auto Scaling



·        An Elastic Load Balancer provides a DNS host name
o   The name clients should connect to
o   This IP address may change over time
o   Use a CNAME alias to use your own domain name to reference the ELB
§  Never use an “A” record!
·        ELBs are designed to be fault-tolerant
o   Only need to define a single ELB
o   One ELB can span multiple availability zones
·        ELBs support HTTPS
o   Can upload your own SSL certificate

Routing Request

Ø  ELB default is to route requests to the instance with the smallest load
o   The ELB keeps track of this
Ø  Can also configure ELB to persist sessions (called sticky sessions)
o   All requests from a single user will be routed to the same instance
o   Implemented with either
§  ELB-generated HTTP cookies
§  Application-generated HTTP cookies
Ø  Generally, sticky sessions should be avoided
o   Goes against many benefits of cloud computing
o   Assumes that a particular instance will be running



 Configuring a Load Balancer:

Ø  Can configure with any of the management tools
o   This section will use the Management Console
Ø  To configure a load balancer with the Management Console
o   From the EC2 service, click Load Balancers, then Create Load Balancer
o   Specify a name for the load balancer and which protocols/port numbers to load balance
Ø  Add at least two subnets to load balance
Ø  Click Next
Ø  Select a security group for the load balancer to use
Ø  Click Next
 



 


Ø  The next screen allows for custom health checks to be created, specifying
o   Protocol, port, and path to perform the check
§  Path is only for HTTP(S)
o   Time to wait for a response
o   How often to perform the check
o   Number of consecutive failures before marking down
Ø  Number of consecutive successes before marking healthy


Ø  Existing instances can be manually added to the load balancer when created
o   Just select them in the table of existing images
 



Ø  Once created, a load balancer constantly monitors instances
o   Ensures that they are all healthy and will only route traffic to healthy instances
 


  
 


Auto Scaling and Load Balancing

Ø  Auto Scaling and load balancing can be used together
o   New instances started by an Auto Scaling policy can be automatically registered with a load balancer
Ø  Enable by specifying an load balancer when creating or updating an Auto Scaling group
o   Can specify more than one load balancer

#aws autoscaling create-auto-scaling-group --auto-scaling-group-name user01ASGrp --launch-configuration-name user01LC --vpc-zone-identifier subnet-41767929c --minsize2 --max-size 4 --load-balancer-names <load_Bal-1> <load_Bal-2>...

ELB Limits

Ø  AWS accounts are initially limited to 10 load balancers
Ø  Higher limits can be requested at http://aws.amazon.com/contact-us/elb-request/
o   Requests are for a specific region

Exam Topics:

·        In Service or Out of Service
·        Health Checks

·        Have their own DNS name. You are never given an IP address.

1 comment: