Thursday, August 31, 2023

LAB ON AWS APPLICATION LOAD BALANCER

 



In AWS (Amazon Web Services), an Application Load Balancer (ALB) is a layer 7 load balancing solution that operates at the application layer (Layer 7) of the OSI model. It is designed to distribute incoming traffic to targets based on the content of the HTTP/HTTPS requests.

The Application Load Balancer provides advanced features and capabilities compared to the Network Load Balancer. It can intelligently distribute traffic across multiple targets such as Amazon EC2 instances, containers, IP addresses, or AWS Lambda functions, based on various factors including URL path, host headers, HTTP methods, and request headers.

Here are some key features and benefits of the Application Load Balancer:

  1. Advanced request routing: The ALB supports intelligent request routing based on various application-level attributes. You can configure rules and conditions to route traffic to different target groups based on URL paths, host headers, HTTP methods, or custom request headers.
  2. Content-based routing: The ALB can route requests to different target groups based on the content of the requests. This allows you to implement advanced routing logic and direct traffic to specific targets based on application-specific requirements.
  3. Support for HTTP/HTTPS: The ALB supports both HTTP and HTTPS traffic, making it suitable for web applications. It can terminate SSL/TLS connections and offload the encryption/decryption process from the targets.
  4. WebSocket support: The ALB can handle WebSocket traffic, which is used in real-time applications and enables bidirectional communication between clients and servers.
  5. Load balancing across multiple Availability Zones: The ALB can distribute traffic across multiple Availability Zones, improving the availability and fault tolerance of your application.
  6. Advanced health checks: The ALB performs health checks on targets to ensure they are available and healthy. It can use different health check types, such as HTTP, HTTPS, TCP, or custom-defined health checks.
  7. Integration with AWS services: The ALB integrates with other AWS services like Auto Scaling, AWS Certificate Manager, AWS WAF (Web Application Firewall), and AWS CloudFormation, allowing you to build scalable and secure infrastructure.

When you configure an Application Load Balancer, you define one or more listeners to specify the incoming traffic’s port and protocol (HTTP or HTTPS). You also create target groups to specify the targets that will receive the traffic. The ALB intelligently distributes traffic to the targets based on the rules and conditions you define.

Create Two EC2 Instances:

Choose free tier server.t2.micro:

Create security-key:

Edit Network Settings:

Create Security Group:

Rules will be configured later in the lab:

Launch Instance 1:

Note: Also create the instance-2 in the default VPC but in a different zone.

Verification:

Configure IIS Server in both EC2 Instances:

First Connect EC2 Instances:

Create an index.html File In Both Instances:

Configure ELB:

Target Group:

Register target(instances) with target group:

Now configure ELB with the newly created Target Group:

ELB VERIFICATION:

As we refresh the page twice it will shift the traffic on server 2.


End Of Lab: Good Luck!!!

No comments:

Post a Comment