SlideShare a Scribd company logo
How To Configure Amazon EC2 Load Balancer
i | P a g e
Table of Contents
Overview ...........................................................................................................................................1
Applies To..........................................................................................................................................1
Pre-requisites.....................................................................................................................................1
Launch Instance..................................................................................................................................1
System Update...................................................................................................................................1
Node #1 – OS Packages Update....................................................................................................1
Node #2 – OS Packages Update....................................................................................................2
NTP Configuration ..............................................................................................................................2
System Date Time...............................................................................................................................3
Install – Web Server............................................................................................................................3
Webserver – Index File........................................................................................................................4
Add Node #1 – Content ...............................................................................................................4
Add Node #2 – Content ...............................................................................................................4
LoadBalancer......................................................................................................................................5
Load Balancer – Create LoadBalancer...............................................................................................5
Load Balancer – Definition...............................................................................................................5
Define LoadBalancer Name..........................................................................................................5
Create – Internal LoadBalancer....................................................................................................6
Create – Enable advanced VPC Configuration – Select Subnets.......................................................6
Create – Enable advanced VPC Configuration – Selected Subnets...................................................7
Verify – Security Group................................................................................................................7
Create – Assign Security Group ....................................................................................................8
Create – Configure Security Settings.............................................................................................8
Create – Configure Health Check..................................................................................................9
Create – Configure Health Check - Advanced.................................................................................9
Create – Configure Health Check - Advanced...............................................................................10
Create – Add Tag.......................................................................................................................10
Create – Review ........................................................................................................................11
Create – Creation Status – Progress............................................................................................11
How To Configure Amazon EC2 Load Balancer
ii | P a g e
Create – Creation Status – Successful .........................................................................................12
LoadBalancer – DNS Name................................................................................................................12
LoadBalancer – Test – First Request...............................................................................................12
LoadBalancer – Test – Second Request...........................................................................................12
Load Balancer – Instance Status.........................................................................................................13
Load Balancer – Availability Configured..............................................................................................13
Load Balancer – Remove Subnet........................................................................................................14
How To Configure Amazon EC2 Load Balancer
1 | P a g e
Overview
The purpose of thisdocumentis to configure AmazonAWSLoadBalancer with2 nodes(instance).Inthis
guide we will install apahce2 webserver on both the nodes to test the availability. The main purpose of
loadbalancer is service high availability.
Applies To
Amazon EC2 Instance
Pre-requisites
A minimum of 2 EC2 instances have to be running. In this document we would be configuring Linux
Operating System.
Launch Instance
Launch 2 instances of a Linux Operating System and start the instance.
System Update
Loginwiththe public IP address and update the operating system packages. Run the below command.
sudo yum update
Node #1 – OS Packages Update
How To Configure Amazon EC2 Load Balancer
2 | P a g e
Node #2 – OS Packages Update
NTP Configuration
Nextstepisto ensure NTPis configuredandTime serverisenabledtoverifyrunthe below commandon
both nodes.
cat /etc/ntp.conf | grep ^server
How To Configure Amazon EC2 Load Balancer
3 | P a g e
System Date Time
Next step is to ensure date and Time on both nodes are in sync and are set to same timezone (UTC).
Install – Web Server
After updating operating system “install web server”, to install the webserver group run the below
command on both the nodes (instances).
yum groupinstall -y "Web Server"
How To Configure Amazon EC2 Load Balancer
4 | P a g e
Webserver – Index File
Create a new “index.html” file in “/var/www/html” directory to create run the below command, run on
both the nodes.
cd /var/www/html
touch index.html
chmod 755 index.html
Add Node #1 – Content
Edit the “index.html” and a line to be displayed upon request from the browser.
<HTML>
<BODY>
<H1> This is message is from node ...... <i> One </i>
</BODY>
</HTML>
Add Node #2 – Content
Edit the “index.html” and a line to be displayed upon request from the browser.
<HTML>
<BODY>
<H1> This is message is from node ...... <i> Two </i>
</BODY>
</HTML>
How To Configure Amazon EC2 Load Balancer
5 | P a g e
LoadBalancer
The purpose of load balancer is to ensure service is
Load Balancer – Create LoadBalancer
Navigate to “Network & Security  Load Balancers” and click on “Create Load Balancer” button.
Load Balancer – Definition
Define LoadBalancer Name
In this step you need to define the loadbalancer name and Create LB inside (which inside network).
How To Configure Amazon EC2 Load Balancer
6 | P a g e
Create – Internal LoadBalancer
This option is to enable the loadbalancer only within the internal network. Ideally we configure load
balancer to the internet facing ones. Hence we would not choose the option.
Create – Enable advanced VPC Configuration – Select Subnets
This option is to enable the loadbalancer available to other availability zones and choose other zonesif
you need configure for higher availability.
How To Configure Amazon EC2 Load Balancer
7 | P a g e
Create – Enable advanced VPC Configuration – Selected Subnets
Choose the availability zones from different subnets, if needed for higher availability.
Verify – Security Group
In this guide,we are configuringhttpdservice,we needto ensure thatport 80 is openfrom the security
groups.
How To Configure Amazon EC2 Load Balancer
8 | P a g e
Create – Assign Security Group
Choose existing security groups or create new security group, if you opt to choose create new security
group ensure Port “80” rule is added.
Create – Configure Security Settings
In this guide we are configuring simple Load balancer without security feature. In order to configure
security you could configure HTTPS or SSL protocol for secured connections.
How To Configure Amazon EC2 Load Balancer
9 | P a g e
Create – Configure Health Check
Type of protocol “HTTP” and on port “80” and file “/index.html” that would be verified.
Create – Configure Health Check - Advanced
Inthissectionyouneedconfigureloadbalancerparameters,suchasResponseTimeout,intervalandother
parameters.
How To Configure Amazon EC2 Load Balancer
10 | P a g e
Create – Configure Health Check - Advanced
Nextstepwouldbe addthe EC2 instancesintothe loadbalancer.Clickonthe nodes thathasto be part of
the load balancer.
Create – Add Tag
Next step would be add tag to the loadbalancer.
How To Configure Amazon EC2 Load Balancer
11 | P a g e
Create – Review
Review the loadbalancer and click on “Create” button.
Create – Creation Status – Progress
Upon clicking “Create” button; Loadbalancer creation progress is displayed.
How To Configure Amazon EC2 Load Balancer
12 | P a g e
Create – Creation Status – Successful
After configuring the loadbalancer, loadbalancer will be created.
LoadBalancer – DNS Name
After creating loadbalancer successfully, DNS Name will be associated.
LoadBalancer – Test – First Request
Launch the DNS Name from the browser; the request is fetched from node One.
LoadBalancer – Test – Second Request
Launch the DNS Name from the browser; the request is fetched from node Two.
How To Configure Amazon EC2 Load Balancer
13 | P a g e
Load Balancer – Instance Status
From the load balancer choose the “effonelb”, click on the “Instances” to know the status of nodes.
s
Load Balancer – Availability Configured
From the load balancer choose the “effonelb”, click on the “Instances” to know the availability zones
configured.
How To Configure Amazon EC2 Load Balancer
14 | P a g e
Load Balancer – Remove Subnet
To remove zone(s) from the configured availability zones, click on “Remove from Load Balancer”.

More Related Content

PDF
How To Create EC2 instance Linux Server
PDF
Amazon AWS Identity Access Management
DOCX
How to Configure Amazon AWS EC2 Elastic IP Address
PDF
How To Create EBS Snapshot and Restore EBS Snapshot – Linux Instance
PDF
How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7
PDF
How To Connect Amazon AWS EC2 with Key Pair – Linux
PDF
How To Configure Amazon EC2 Security Groups
PDF
How To Install and Configure AWS CLI for Windows
How To Create EC2 instance Linux Server
Amazon AWS Identity Access Management
How to Configure Amazon AWS EC2 Elastic IP Address
How To Create EBS Snapshot and Restore EBS Snapshot – Linux Instance
How To Create RDS Database for WordPress in AWS on RHEL 7 or CentOS 7
How To Connect Amazon AWS EC2 with Key Pair – Linux
How To Configure Amazon EC2 Security Groups
How To Install and Configure AWS CLI for Windows

What's hot (18)

PDF
How To Configure Amazon EC2 Load Balancer
DOCX
How to connect amazon aws ec2 with key pair – linux
PDF
How To Install and Configure Apache SSL on CentOS 7
PDF
How To Check IE Enhanced Security Is Enabled Windows PowerShell
PDF
How To Configure FirewallD on RHEL 7 or CentOS 7
PDF
How To Create PowerShell Function
PDF
How To List Nginx Modules Installed / Complied on CentOS 7
PDF
How To Check file exists and Delete PowerShell
PDF
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
PDF
User guide
DOCX
Guide - Migrating from Heroku to AWS using CloudFormation
PDF
Install and Configure RSyslog – CentOS 7 / RHEL 7
PDF
Windows PowerShell Basics - How To List PSDrive Info
PPTX
Secure360 - Beyond xp cmdshell - Owning the Empire through SQL Server
PDF
PowerUpSQL - 2018 Blackhat USA Arsenal Presentation
PPTX
2019 Blackhat Booth Presentation - PowerUpSQL
PDF
Moving Drupal to the Cloud
PDF
How To Create Power Shell Function Mandatory Parameter Value
How To Configure Amazon EC2 Load Balancer
How to connect amazon aws ec2 with key pair – linux
How To Install and Configure Apache SSL on CentOS 7
How To Check IE Enhanced Security Is Enabled Windows PowerShell
How To Configure FirewallD on RHEL 7 or CentOS 7
How To Create PowerShell Function
How To List Nginx Modules Installed / Complied on CentOS 7
How To Check file exists and Delete PowerShell
Install and Configure WordPress in AWS on RHEL 7 or CentOS 7
User guide
Guide - Migrating from Heroku to AWS using CloudFormation
Install and Configure RSyslog – CentOS 7 / RHEL 7
Windows PowerShell Basics - How To List PSDrive Info
Secure360 - Beyond xp cmdshell - Owning the Empire through SQL Server
PowerUpSQL - 2018 Blackhat USA Arsenal Presentation
2019 Blackhat Booth Presentation - PowerUpSQL
Moving Drupal to the Cloud
How To Create Power Shell Function Mandatory Parameter Value
Ad

Similar to How to configure amazon ec2 load balancer (20)

PDF
How To Configure Nginx Load Balancer on CentOS 7
PDF
AWS essentials EC2
PDF
Sun_AmazonEC2_GettingStartedGuide
PDF
ArcMC for AWS 2.2 P1 Setup Guide
PPTX
Spring boot-application
PPTX
How to make a Load Testing with Visual Studio 2012
PPTX
AWS Instance Preparation
PPTX
Aws overview part 2(compute services)
PDF
AngularJS Unit Test
PDF
Automated Amazon EC2 Cloud deployments with openQRM
PDF
Aws project jenkins-build-server
DOCX
Final Report To Executive ManagersXXXXXCCA 625Un
DOCX
Lampstack (1)
ODP
AutoScaling and Drupal
PDF
Configuring Highly Scalable Compile Masters, Vasco Cardoso, AWS
PDF
AWS Certified Solutions Architect Associate Exam Guide 1st Edition 2024_KIRAN...
PPT
Auto Scaling on AWS
PPT
Setting up the hyperledger composer in ubuntu
PDF
Glassfish JEE Server Administration - Module 4 Load Balancer
PDF
Awsgsg wah-linux
How To Configure Nginx Load Balancer on CentOS 7
AWS essentials EC2
Sun_AmazonEC2_GettingStartedGuide
ArcMC for AWS 2.2 P1 Setup Guide
Spring boot-application
How to make a Load Testing with Visual Studio 2012
AWS Instance Preparation
Aws overview part 2(compute services)
AngularJS Unit Test
Automated Amazon EC2 Cloud deployments with openQRM
Aws project jenkins-build-server
Final Report To Executive ManagersXXXXXCCA 625Un
Lampstack (1)
AutoScaling and Drupal
Configuring Highly Scalable Compile Masters, Vasco Cardoso, AWS
AWS Certified Solutions Architect Associate Exam Guide 1st Edition 2024_KIRAN...
Auto Scaling on AWS
Setting up the hyperledger composer in ubuntu
Glassfish JEE Server Administration - Module 4 Load Balancer
Awsgsg wah-linux
Ad

More from VCP Muthukrishna (20)

PDF
How to Fix Duplicate Packages in YUM on CentOS 7
PDF
How To Install and Configure GNome on CentOS 7
PDF
How To Connect to Active Directory User Validation
PDF
How To Connect To Active Directory PowerShell
PDF
How To List Files on Remote Server - PowerShell
PDF
How To List Files and Display In HTML Format
PDF
How To Check and Delete a File via PowerShell
PDF
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
PDF
How To Setup SSH Keys on CentOS 7
PDF
How To Install and Configure Open SSH Server on Ubuntu
PDF
Windows PowerShell Basics – How To Create powershell for loop
PDF
How To Construct IF and Else Conditional Statements
PDF
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
PDF
How To Disable IE Enhanced Security Windows PowerShell
PDF
Nginx bind() to 0.0.0.0:9080 failed
PDF
How To Install and Configure Screen on CentOS 7
PDF
How To Install and Configure Salt Master on Ubuntu
PDF
How To Protect SSH Access with Fail2Ban on RHEL 7
PDF
How To Configure SNMP Logging on RHEL 7
PDF
How To Find Package Installation Date on RHEL 7
How to Fix Duplicate Packages in YUM on CentOS 7
How To Install and Configure GNome on CentOS 7
How To Connect to Active Directory User Validation
How To Connect To Active Directory PowerShell
How To List Files on Remote Server - PowerShell
How To List Files and Display In HTML Format
How To Check and Delete a File via PowerShell
Zimbra Troubleshooting - Mails not being Delivered or Deferred or Connection ...
How To Setup SSH Keys on CentOS 7
How To Install and Configure Open SSH Server on Ubuntu
Windows PowerShell Basics – How To Create powershell for loop
How To Construct IF and Else Conditional Statements
How To Create PowerShell Function Mandatory Parameter and Optional Parameter
How To Disable IE Enhanced Security Windows PowerShell
Nginx bind() to 0.0.0.0:9080 failed
How To Install and Configure Screen on CentOS 7
How To Install and Configure Salt Master on Ubuntu
How To Protect SSH Access with Fail2Ban on RHEL 7
How To Configure SNMP Logging on RHEL 7
How To Find Package Installation Date on RHEL 7

How to configure amazon ec2 load balancer

  • 1. How To Configure Amazon EC2 Load Balancer i | P a g e Table of Contents Overview ...........................................................................................................................................1 Applies To..........................................................................................................................................1 Pre-requisites.....................................................................................................................................1 Launch Instance..................................................................................................................................1 System Update...................................................................................................................................1 Node #1 – OS Packages Update....................................................................................................1 Node #2 – OS Packages Update....................................................................................................2 NTP Configuration ..............................................................................................................................2 System Date Time...............................................................................................................................3 Install – Web Server............................................................................................................................3 Webserver – Index File........................................................................................................................4 Add Node #1 – Content ...............................................................................................................4 Add Node #2 – Content ...............................................................................................................4 LoadBalancer......................................................................................................................................5 Load Balancer – Create LoadBalancer...............................................................................................5 Load Balancer – Definition...............................................................................................................5 Define LoadBalancer Name..........................................................................................................5 Create – Internal LoadBalancer....................................................................................................6 Create – Enable advanced VPC Configuration – Select Subnets.......................................................6 Create – Enable advanced VPC Configuration – Selected Subnets...................................................7 Verify – Security Group................................................................................................................7 Create – Assign Security Group ....................................................................................................8 Create – Configure Security Settings.............................................................................................8 Create – Configure Health Check..................................................................................................9 Create – Configure Health Check - Advanced.................................................................................9 Create – Configure Health Check - Advanced...............................................................................10 Create – Add Tag.......................................................................................................................10 Create – Review ........................................................................................................................11 Create – Creation Status – Progress............................................................................................11
  • 2. How To Configure Amazon EC2 Load Balancer ii | P a g e Create – Creation Status – Successful .........................................................................................12 LoadBalancer – DNS Name................................................................................................................12 LoadBalancer – Test – First Request...............................................................................................12 LoadBalancer – Test – Second Request...........................................................................................12 Load Balancer – Instance Status.........................................................................................................13 Load Balancer – Availability Configured..............................................................................................13 Load Balancer – Remove Subnet........................................................................................................14
  • 3. How To Configure Amazon EC2 Load Balancer 1 | P a g e Overview The purpose of thisdocumentis to configure AmazonAWSLoadBalancer with2 nodes(instance).Inthis guide we will install apahce2 webserver on both the nodes to test the availability. The main purpose of loadbalancer is service high availability. Applies To Amazon EC2 Instance Pre-requisites A minimum of 2 EC2 instances have to be running. In this document we would be configuring Linux Operating System. Launch Instance Launch 2 instances of a Linux Operating System and start the instance. System Update Loginwiththe public IP address and update the operating system packages. Run the below command. sudo yum update Node #1 – OS Packages Update
  • 4. How To Configure Amazon EC2 Load Balancer 2 | P a g e Node #2 – OS Packages Update NTP Configuration Nextstepisto ensure NTPis configuredandTime serverisenabledtoverifyrunthe below commandon both nodes. cat /etc/ntp.conf | grep ^server
  • 5. How To Configure Amazon EC2 Load Balancer 3 | P a g e System Date Time Next step is to ensure date and Time on both nodes are in sync and are set to same timezone (UTC). Install – Web Server After updating operating system “install web server”, to install the webserver group run the below command on both the nodes (instances). yum groupinstall -y "Web Server"
  • 6. How To Configure Amazon EC2 Load Balancer 4 | P a g e Webserver – Index File Create a new “index.html” file in “/var/www/html” directory to create run the below command, run on both the nodes. cd /var/www/html touch index.html chmod 755 index.html Add Node #1 – Content Edit the “index.html” and a line to be displayed upon request from the browser. <HTML> <BODY> <H1> This is message is from node ...... <i> One </i> </BODY> </HTML> Add Node #2 – Content Edit the “index.html” and a line to be displayed upon request from the browser. <HTML> <BODY> <H1> This is message is from node ...... <i> Two </i> </BODY> </HTML>
  • 7. How To Configure Amazon EC2 Load Balancer 5 | P a g e LoadBalancer The purpose of load balancer is to ensure service is Load Balancer – Create LoadBalancer Navigate to “Network & Security  Load Balancers” and click on “Create Load Balancer” button. Load Balancer – Definition Define LoadBalancer Name In this step you need to define the loadbalancer name and Create LB inside (which inside network).
  • 8. How To Configure Amazon EC2 Load Balancer 6 | P a g e Create – Internal LoadBalancer This option is to enable the loadbalancer only within the internal network. Ideally we configure load balancer to the internet facing ones. Hence we would not choose the option. Create – Enable advanced VPC Configuration – Select Subnets This option is to enable the loadbalancer available to other availability zones and choose other zonesif you need configure for higher availability.
  • 9. How To Configure Amazon EC2 Load Balancer 7 | P a g e Create – Enable advanced VPC Configuration – Selected Subnets Choose the availability zones from different subnets, if needed for higher availability. Verify – Security Group In this guide,we are configuringhttpdservice,we needto ensure thatport 80 is openfrom the security groups.
  • 10. How To Configure Amazon EC2 Load Balancer 8 | P a g e Create – Assign Security Group Choose existing security groups or create new security group, if you opt to choose create new security group ensure Port “80” rule is added. Create – Configure Security Settings In this guide we are configuring simple Load balancer without security feature. In order to configure security you could configure HTTPS or SSL protocol for secured connections.
  • 11. How To Configure Amazon EC2 Load Balancer 9 | P a g e Create – Configure Health Check Type of protocol “HTTP” and on port “80” and file “/index.html” that would be verified. Create – Configure Health Check - Advanced Inthissectionyouneedconfigureloadbalancerparameters,suchasResponseTimeout,intervalandother parameters.
  • 12. How To Configure Amazon EC2 Load Balancer 10 | P a g e Create – Configure Health Check - Advanced Nextstepwouldbe addthe EC2 instancesintothe loadbalancer.Clickonthe nodes thathasto be part of the load balancer. Create – Add Tag Next step would be add tag to the loadbalancer.
  • 13. How To Configure Amazon EC2 Load Balancer 11 | P a g e Create – Review Review the loadbalancer and click on “Create” button. Create – Creation Status – Progress Upon clicking “Create” button; Loadbalancer creation progress is displayed.
  • 14. How To Configure Amazon EC2 Load Balancer 12 | P a g e Create – Creation Status – Successful After configuring the loadbalancer, loadbalancer will be created. LoadBalancer – DNS Name After creating loadbalancer successfully, DNS Name will be associated. LoadBalancer – Test – First Request Launch the DNS Name from the browser; the request is fetched from node One. LoadBalancer – Test – Second Request Launch the DNS Name from the browser; the request is fetched from node Two.
  • 15. How To Configure Amazon EC2 Load Balancer 13 | P a g e Load Balancer – Instance Status From the load balancer choose the “effonelb”, click on the “Instances” to know the status of nodes. s Load Balancer – Availability Configured From the load balancer choose the “effonelb”, click on the “Instances” to know the availability zones configured.
  • 16. How To Configure Amazon EC2 Load Balancer 14 | P a g e Load Balancer – Remove Subnet To remove zone(s) from the configured availability zones, click on “Remove from Load Balancer”.