practical

  1. Creating a load balancer

Create an instance (rhel) -> install httpd -> service restart

-> create index.html (any content) -> service -> add http for sg - > check it is working -> go to load balancer -> based on the load balancer you need select the load balancer -> classic load balancer -> add a name and default vpc -> select sg which support ssh and http -> configure health check -> response timeout (5 sec : time to wait when receiving a response from the health check) -> interval (amount of time between health checks) -> unhealthy threshold (2 no of consecutive health check failures before declaring an EC2 instance unhealthy, note : in 60 sec it checks 2 time since interval is 30) -> healthy threshold (no of consecutive health check successes before declaring an ec2 instance healthy) -> add the instance -> enable cross end load balancing (cross end load balancing distributes traffic evenly across all your back-end instances in all available zones) -> enable connection draining (the no.of sec to allow existing traffic to continue flowing) -> create -> wait for 1 min till it become in-service (status of instance) -> get the public dns of load balancer and paste it in the new tab e.g. dns/index.html

  1. When you create a load balancer in a VPC, you must choose whether to make it an internal load balancer or an Internet- facing load balancer. The nodes of an Internet-facing load balancer have public IP addresses.

  2. The DNS name of an Internet-facing load balancer ispublicly resolvable to the public IP addresses of the nodes. Therefore, Internet-facing load balancers can route requests from clients over the Internet.

  3. The nodes of an internal load balancer have only private IP addresses. The DNS name of an internal load balancer is publicly resolvable to the private IP addresses of the nodes. Therefore, internal load balancers can only route requests from clients with access to the VPC for the load balancer.

  • Max 20 load balancer per region.

  • Max 5 SG for load balancer.

  • Max 1 subnet for load balancer. Deleting a load balancer does not affect its EC2 instance.

Last updated