Practice Questions and Lab Exercises
Now do this lab yourself. When you finish, delete the load balancer.
चला, आता हा lab स्वतः करा. संपल्यावर load balancer delete करा.
चलो, अब यह lab खुद करो. खत्म होने पर load balancer delete करो.
- Write the eight steps of one request, from the DNS name to the response, with no product names invented.
- The balancer is not an EC2. How many EC2 instances does this lab register, what is the minimum that still returns a page, and what can change that count?
- Instance A is stopped and DNS still has both A records. What does the user who received IP1 see? What does a target group do differently?
- Which row do you use for HTTP host rules, for TCP with a static IP, for a firewall appliance, and for an old Classic balancer?
- Two instances are healthy in
site-a-tg. Which setting takes turns, and which setting prefers the quieter instance? Which feature sends/api/*tosite-b-tginstead? - Draw Mumbai and Singapore. Why can
lab-albnot register a Singapore EC2? What does Route 53 send back, and what does the chosen balancer do next? -
Lab. Do these in order.
- Put Nginx on instance A and instance B with different pages.
- Open IP1 and IP2 and write down both sentences.
- Stop A and show that IP1 fails while IP2 still works. Start A again.
- Create
site-a-tgandsite-b-tgand wait until both are healthy. - Create
lab-albforwarding port 80 tosite-a-tg. - Add the path rule
/api/*tosite-b-tg. - Add the host rule
api.example.comtosite-b-tg. - Curl
/,/api/, and both Host headers. Save the four answers. - On paper, add a second region and a Route 53 latency record. Do not launch extra instances.
- Delete
lab-alband any Network Load Balancer you created. Deregister the targets.
-
On paper, one balancer, three groups:
TG-web2 instances port 80,TG-api3 instances port 8080,TG-images2 instances port 80. Which path reaches which group, and what is the default when no rule matches? - Health check values we set: interval 30 seconds, healthy threshold 2, unhealthy threshold 2. About how long is two successes, and about how long is two failures on the checkout group if its interval is 10 seconds?
- Draw the internet-facing balancer in
172.16.0.0/24and172.16.1.0/24, and the internal balancer in172.16.10.0/24and172.16.11.0/24. Who is allowed to open port 8080? - Network Load Balancer, cross-zone off, AZ a has 2 healthy targets, AZ b has 4. If half the clients arrive at each node, what share does one AZ a target get, and what share does one AZ b target get? What is each target's share when cross-zone is on?
- Two alias records for
www.example.com, latency routing, evaluate target health on. Mumbai targets are all unhealthy. Which region's balancer should Route 53 return?
Understood? A load balancer is one DNS name, it picks a healthy EC2, and it sends the response back. Another region needs another balancer. Now repeat the lab without looking at the notes.
समजला का? Load balancer एकाच DNS नाव आहे, healthy EC2 निवडतो, आणि उत्तर परत पाठवतो. वेगळ्या region ला वेगला balancer लागतो. आता हा lab notes बघितल्याशिवाय परत करा.
समझ आए? Load balancer एक ही DNS नाम है, healthy EC2 चुनता है, और जवाब वापस भेजता है. दूसरे region को दूसरा balancer लगता है. अब यह lab notes देखे बिना दोबारा करो.
Quick Revision
- One request: DNS name, load balancer, one healthy target, response back. The user does not choose the EC2.
- The balancer is not your EC2. Minimum that answers is 1 healthy target. This lab uses 2. Auto Scaling can change the count. Zero healthy targets is a 502.
- Manual DNS can return two IPs. It does not notice a stopped instance.
- Manual DNS when you have no balancer. ALB for HTTP/HTTPS and path or host rules. NLB for TCP/UDP and a static IP. GWLB for firewall appliances. Classic only if an old setup already uses it.
- A target group is the instance list plus the health check. One listener forwards to a group.
/api/*can forward to another group. - Round robin and least outstanding requests choose an instance inside the chosen group. Host and path rules choose the group.
- One Application Load Balancer does not span regions. Each region has its own balancer and its own EC2 instances. Route 53 latency or geolocation routing picks the region. That balancer then distributes inside the region.
- New instance healthy first, then remove the old one.
- One balancer, many target groups. Rules pick the group.
TG-web2 on port 80,TG-api3 on port 8080,TG-images2 on port 80. Checkout desired 2 stays apart from browsing desired 4. - Listeners: HTTP 80 redirects 301 to HTTPS 443. Smaller priority number wins. Certificate on 443 only. Port 8080 stays on the internal balancer.
- Health check we set:
/health, 30 seconds, timeout 5, healthy 2, unhealthy 2, success 200. Do not point it at a login redirect or a slow database. - Internet-facing balancer in public subnets. Internal balancer in private subnets. Scheme is fixed at create time.
- Three tiers: public balancer, web group min 2 desired 2 max 6, internal balancer, app group min 2 desired 2 max 4, RDS with no balancer in front. Port 3306 only from the app tier.
- Application Load Balancer cross-zone stays on. Network Load Balancer cross-zone is off until you enable it. 2 and 4 targets: about 25 percent and 12.5 percent when off, about 16.7 percent each when on.
- One name
www.example.com, two regional balancers, Route 53 latency or geolocation. Failover needs evaluate target health. That is not cross-zone.