Elastic Load Balancing (ELB) automatically distributes incoming application traffic across multiple AWS EC2 instances. This ensures that the load is equally distributed, allowing applications to scale and provide a fault-tolerant system with no single point of failure. There are three types of load balancer that AWS offers: Classic Load Balancer (CLB), Application Load Balancer (ALB), and Network Load Balancer (NLB).

Table of Contents

Configuring Elastic Load Balancer (ELB)

Setting up an ELB involves the following steps:

  • Define Load Balancer: Navigate to the EC2 console, and locate the Load Balancer section. Start by creating a new load balancer (selecting your preferred type among CLB, ALB, NLB).
  • Assign security groups: Security groups operate at the instance level, so the ELB will need to be assigned to the same security group as the EC2 instances it will direct traffic to.
  • Configure Load Balancer attributes: Define the load balancer protocol and port, and the instance protocol and port.
  • Add instances to Load Balancer: Add the desired EC2 instances to the load balancer.
  • Add health checks: ELB automatically performs health checks on EC2 instances and only directs traffic to instances that pass the health check.

In code, using the AWS CLI, you can establish an ELB with a health check in the following way:

aws elbv2 create-load-balancer –name my-load-balancer –subnets subnet-0abc123def6gh78ij subnet-0abcdef123ghi456j
aws elbv2 modify-target-group –target-group-arn arn:aws:elasticloadbalancing:us-east-2:123456789012:targetgroup/my-targets/73e2d6bc24d8a067 –health-check-protocol HTTP –health-check-port 80 –health-check-path /healthcheck

Amazon Route 53 Health Checks Overview

Amazon Route 53 is AWS’s scalable and highly available Domain Name System (DNS). Route 53 health checks monitor the health and performance of your web applications, web servers, and other resources. Each health check that you create can monitor either the status of a specified resource or the status of other health checks.

Configuring Route 53 Health Checks

Setting up a Route 53 health check involves the following steps:

  • Navigate to Route 53: Navigate to the Route 53 dashboard and head to Health checks.
  • Create health check: Click ‘Create health check’, which will bring up a dialog box asking for the details of the health check.
  • Configure settings: You need to enter a name for your health check, choose the IP address of the endpoint you wish to check, and the protocol you wish to use for the health check (HTTP, HTTPS, or TCP).
  • Advanced configuration: You can choose further advanced settings including Response timeout, Request interval, Failures before the alarm, Path to check etc.
  • Create an Alarm: Finally, you can choose to set an alarm that will notify the given email address when a failure happens.

In code, using AWS CLI, a health check can be established like below:

aws route53 create-health-check –caller-reference 1 –health-check-config IPAddress=192.0.2.227,Type=HTTP,ResourcePath=/,FailureThreshold=2

Properly configured, both the Elastic Load Balancing and Amazon Route 53 health checks can form a defensive layer to maintain the high availability and health of your AWS applications. It is necessary to understand these services as part of the key study areas for the AWS Certified SysOps Administrator – Associate (SOA-C02) exam. Understanding ELB and Route 53 health checks will also be beneficial in the workplace, where they play crucial roles in achieving operational excellence.

Practice Test

True/False: Elastic Load Balancing supports three types of load balancers: Application Load Balancers, Network Load Balancers, and Classic Load Balancers.

  • True
  • False

Answer: True.

Explanation: Yes, Elastic Load Balancing supports all three types of load balancers, which provide robust and scalable services to distribute incoming traffic to multiple targets simultaneously.

What protocol does Amazon Route 53 health check monitor?

  • a) HTTP
  • b) TCP
  • c) ICMP
  • d) All of the Above

Answer: d) All of the Above.

Explanation: Amazon Route 53 health checks monitor the health of your resources by making regular Internet Protocol (IP) requests using either HTTP, TCP, or ICMP protocol.

True/False: Amazon Route 53 cannot monitor the health of end points outside the Amazon Web Services.

  • True
  • False

Answer: False.

Explanation: Amazon Route 53 can also monitor the health of endpoints outside of AWS. You can set up health checks for any accessible endpoint, allowing for exhaustive monitoring.

Which of the following load balancer types operate at the transport level (Layer 4) of OSI?

  • a) Application Load Balancers
  • b) Network Load Balancers
  • c) Classic Load Balancers

Answer: b) Network Load Balancers.

Explanation: Network Load Balancers operate at the transport level of the OSI model (Layer 4). They can handle millions of requests per second, while maintaining extremely low latencies.

True/False: Amazon Route 53 enables domain name system (DNS) web service and helps in domain registration.

  • True
  • False

Answer: True.

Explanation: Amazon Route 53 is a highly available and scalable domain name system (DNS) web service that allows users to register domain names and resolve those domain names to internet resources.

Elastic Load Balancing supports which of the following features?

  • a) Automatic scaling
  • b) Load distribution
  • c) Health checks
  • d) All of the Above

Answer: d) All of the Above.

Explanation: Elastic Load Balancing supports automatic scaling, load distribution, and health checks, enabling it to send traffic only to healthy targets.

True/False: Route 53 only sends requests to resources that pass health checks.

  • True
  • False

Answer: True.

Explanation: Using the DNS failover and health checking capabilities of Amazon Route 53, only resources that pass health checks are allowed to receive requests.

Which kind of protocol traffic does Network Load Balancer support?

  • a) TCP
  • b) UDP
  • c) TLS
  • d) All of the Above

Answer: d) All of the Above.

Explanation: Network Load Balancer supports TCP, UDP, and TLS protocol traffic ensuring rapid routing decisions.

True/False: You can not route traffic to multiple applications on a single EC2 instance using Application Load Balancer.

  • True
  • False

Answer: False.

Explanation: You can route traffic to multiple applications on a single EC2 instance using the Application Load Balancer, providing flexibility and high availability.

Which of the following is not a common use case for Application Load Balancer?

  • a) Container-based architectures
  • b) Microservices
  • c) Streaming video services
  • d) Classic architectures

Answer: c) Streaming video services.

Explanation: While Application Load Balancer is great for microservices, container-based architectures, and classic architectures, streaming video services is not a typical use case for it.

Interview Questions

What is Elastic Load Balancing (ELB) in AWS?

Elastic Load Balancing (ELB) automatically distributes incoming application traffic across multiple targets, such as Amazon EC2 instances, containers, and IP addresses.

What kind of checks does ELB perform to evaluate the health of the registered instances?

ELB periodically sends requests, known as health checks, to the registered instances to test their status.

What is meant by Amazon Route 53 Health Checks?

Amazon Route 53 is a scalable Domain Name System (DNS) web service designed to give developers and businesses an extremely reliable and cost-effective way to route end users to Internet applications. Its Health Checks feature monitors the health and performance of your web applications, web servers, and other resources.

How does ELB interact with Amazon Route 53?

ELB integrates with Route 53 to provide DNS failover for your load balancer, directing users to a backup site in case the primary site fails.

What are the types of load balancers provided by ELB?

There are three types of load balancers that ELB provides – Application Load Balancer, Network Load Balancer, and Classic Load Balancer.

How does ELB determine the health of the registered instances?

ELB periodically checks the health of registered instances through a process known as health checking. If an instance does not pass health checks, it will be deregistered from the ELB.

How does Route 53 determine endpoint health?

Route 53 uses health checks to determine the health of endpoints. If an endpoint is unhealthy, the Route 53 DNS failover feature can direct traffic away from the unhealthy endpoint and to other, healthy endpoints.

How does a health check work in Amazon Route 53?

In Amazon Route 53, when you create a health check, it continuously sends a request (HTTP, HTTPS or TCP) to the endpoint. If the endpoint responds successfully within the configured timeout and failure threshold period, Route 53 considers the endpoint to be healthy.

Can you attach both an Application Load Balancer and a Network Load Balancer to the same target group?

No, you cannot attach both an Application Load Balancer and a Network Load Balancer to the same target group in ELB.

How does Amazon Route 53 support high availability?

Route 53 supports high availability by enabling DNS failover. When you specify more than one resource to answer for a particular query and one is unhealthy, Route 53 will automatically reroute the traffic to a healthy resource.

What happens when an instance fails to pass health checks in ELB?

If an instance fails to pass health checks, it is automatically deregistered from the load balancer and the traffic is directed to the remaining healthy instances.

Can Amazon ELB and Amazon Route 53 health checks monitor an application’s end-to-end health?

Yes, they can monitor an application’s end-to-end health, including checking individual software components, connections, load balancing, and final verification via HTTP or TCP checks.

How does health check configuration set up in Route 53?

In the configuration, you specify settings such as the endpoint to route traffic to, the protocol to use to connect with the endpoint, and the frequency of the health checks.

What are the possible statuses for Amazon Route 53 health checks?

The possible statuses for Amazon Route 53 health checks are Healthy, Unhealthy and LastKnownStatus.

Can you use Amazon CloudWatch with ELB to monitor your applications?

Yes, Amazon ELB has built-in integration with Amazon CloudWatch, which allows you to collect and analyze operational data from your ELBs and applications, and set alarms for specific conditions.

Leave a Reply

Your email address will not be published. Required fields are marked *