Wednesday, September 15, 2021
In the previous post we went over what a load balancer is, in this post we are going to create one of types of load balancer AWS offers. We are going to create a Classic Load Balancer, this balancer is not recommended by Amazon, you should only create this if you have to support EC2-Classic instances.
Before we create the load balancer we need to create more than one instances with a web server because we need to test that the load balancer is able to switch.
1. Create two instances with the user data to create Apache Web Servers with these commands in the User Data for instance, if you need the full instruction on how to create instances with User Data you can read this post
#cloud-boothook
#!/bin/bash
#Use this for your user data (script without newlines)
# install httpd (Linux 2 version)
yum update -y
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
echo "Hello world from $(hostname -f)" > /var/www/html/index.html
We just created an index.html file to write out the hostname for testing later on
3. On the create the two instances, if you copy and paste the public DNS or public IP into the address bar of the browser you see the hostname being printed out for the instance, so if the load balancer is successfully the request should change to a different host when a user requests the site
Now its time to create the Classic Load Balancer4. On EC2 Dashboard scroll down to "LOAD BALANCING" and click on "Load Balancers", then click on the "Create Load Balancer" button you will be presented with three choices. The Classic Load Balancer is grayed out because AWS does not want you to choose it. Choose the Classic Load Balancer by clicking on the "Create" button
5. On the next page accept the default because Load Balancer accepts HTTP requests on port 80, so does our instance
6. On the Security Groups page, make sure that you have an inbound rule that accepts HTTP requests on port 80
7. The next page is the Health Check page, it will check the health of the instances by pinging the page index.html on port 80, accept the default and click Next
8. On Add EC2 Instances page you want to add the two instances that we've created with the User Data and accept the default, then click "Next" , click on "Review and Create" and then click on "Create"
Once the Load Balancer has been created you can copy and paste the Load Balancer's DNS into the browser's address bar and it would alternate between the two instances. You will have to wait for a while for it to work, the instances will have a status of OutOfService while it is being added to the load balancerHere is result you should get when everything is finished.
Subscribe to:
Post Comments (Atom)
Search This Blog
Tags
Web Development
Linux
Javascript
DATA
CentOS
ASPNET
SQL Server
Cloud Computing
ASP.NET Core
ASP.NET MVC
SQL
Virtualization
AWS
Database
ADO.NET
AngularJS
C#
CSS
EC2
Iaas
System Administrator
Azure
Computer Programming
JQuery
Coding
ASP.NET MVC 5
Entity Framework Core
Web Design
Infrastructure
Networking
Visual Studio
Errors
T-SQL
Ubuntu
Stored Procedures
ACME Bank
Bootstrap
Computer Networking
Entity Framework
Load Balancer
MongoDB
NoSQL
Node.js
Oracle
VirtualBox
Container
Docker
Fedora
Java
Source Control
git
ExpressJS
MySQL
NuGet
Blogger
Blogging
Bower.js
Data Science
JSON
JavaEE
Web Api
DBMS
DevOps
HTML5
MVC
SPA
Storage
github
AJAX
Big Data
Design Pattern
Eclipse IDE
Elastic IP
GIMP
Graphics Design
Heroku
Linux Mint
Postman
R
SSL
Security
Visual Studio Code
ASP.NET MVC 4
CLI
Linux Commands
Powershell
Python
Server
Software Development
Subnets
Telerik
VPC
Windows Server 2016
angular-seed
font-awesome
log4net
servlets
tomcat
AWS CloudWatch
Active Directory
Angular
Blockchain
Collections
Compatibility
Cryptocurrency
DIgital Life
DNS
Downloads
Google Blogger
Google Chrome
Google Fonts
Hadoop
IAM
KnockoutJS
LINQ
Linux Performance
Logging
Mobile-First
Open Source
Prototype
R Programming
Responsive
Route 53
S3
SELinux
Software
Unix
View
Web Forms
WildFly
XML
cshtml
githu
Thank you for sharing your info. I really appreciate your efforts and I am waiting for your further write ups thank you once again. And know Mimz International Merchandising Company provides services to clients to Make their Vision a Reality and to help companies to improve business performance. merchandising
ReplyDeleteYour post is providing some really good information. I liked its essence and enjoyed reading it.
ReplyDeleteVashikaran Specialist in Chennai Vashikaran Specialist in Jaipur Vashikaran Specialist in Karnataka Vashikaran Specialist in London UK Vashikaran Specialist in Dubai Vashikaran Specialist in Australia Vashikaran Specialist in Punjab
Thank you for sharing Detailed Information. Appreciate it!
ReplyDeleteNice, I really Like Your Article Its look like You Spent a Lot of Time and Effort on Your Blog
ReplyDeleteThanks for Sharing With Us.
PVR Anmol
PVR Maha
Thanks for sharing this, very helpful. Need a logo for your business? Just look below:
ReplyDeletebuy a logo
Nice Blog,I feel like all your ideas are incredible! Great job!!!
ReplyDeleteI have some information about:
Prestige High Fields
Brigade Citadel
Pbel City
Nice Blog... Thank you for sharing this information.
ReplyDeleteBrigade Citadel
2/3 BHK Flats for Sale in Hyderabad
Hi your blog really great and helpful for me. bellen amazone
ReplyDeleteRight-click the icon and choose “Add a Bluetooth Device” from the context menu. If you're using Windows 8 or 10, you'll see a screen like the one below. Just hit the “Pair” button for the device you want to connect
ReplyDeletethe foundry mari crack
SMR Vinay Iconia is developed by SMR Holdings, Located in Kondapur, Hyderabad. It provides 2 & 3 bhk luxury flats available for sale in Affordable prices.
ReplyDeleteSMR Vinay Iconia Structure:
Location of the Project: Kondapur, Near Gachibowli
Available Bedrooms: 2BHK, 3bhk & 4BHK
Total Land area: 22 Acres
Total units : 2550
Total Towers: 11 towers
Total Floors: G+35 floors