In AWS (Amazon Web Services), a Network Load Balancer (NLB) is a highly scalable load balancing solution that operates at the transport layer (Layer 4) of the OSI model. It is designed to handle high volumes of traffic and provide low-latency performance.
The Network Load Balancer is capable of distributing traffic across a group of targets, such as Amazon EC2 instances, containers, IP addresses, or AWS Lambda functions, in a single Availability Zone or across multiple Availability Zones. It uses flow-based load balancing, which allows it to handle millions of requests per second with extremely low latencies.
Here are some key features and benefits of the Network Load Balancer:
- Highly scalable: The NLB is designed to handle high volumes of traffic and can scale to handle millions of requests per second. It automatically scales its capacity in response to incoming traffic patterns.
- Low-latency performance: The NLB provides extremely low latencies by operating at the transport layer and forwarding traffic directly to targets without any proxying. It is ideal for latency-sensitive applications.
- Support for TCP and UDP: The NLB supports both TCP (Transmission Control Protocol) and UDP (User Datagram Protocol) traffic. It can load balance traffic for a wide range of applications and protocols.
- Health checks and failover: The NLB performs health checks on targets to ensure they are available and healthy. It automatically distributes traffic only to healthy targets. If a target fails, the NLB detects it and routes traffic to healthy targets.
- Cross-zone load balancing: The NLB evenly distributes traffic across multiple Availability Zones, which improves the availability and fault tolerance of your application.
- Integration with other AWS services: The NLB integrates seamlessly with other AWS services like Auto Scaling, AWS Certificate Manager, and AWS CloudFormation, allowing you to build scalable and automated infrastructure.
When you configure a Network Load Balancer, you define one or more listeners to specify the incoming traffic’s port and protocol. You also create target groups to specify the targets that will receive the traffic. The NLB intelligently distributes traffic across the targets based on your load balancing configuration.
Create Two EC2 Instances:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684737534685/3b452aad-f016-4225-b4a9-86d9e09ec9cf.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684737564593/ebac0307-e134-4ec1-a029-67b976c9f9f6.png)
Choose free tier server.t2.micro:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684737671058/59e0fcdc-9e92-45a4-98f9-746339dd7f19.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684737704631/af16d602-5b62-4953-869d-74314d3457ae.png)
Create security-key:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684737736802/ed77f7e0-3263-4c73-b87f-6bf153f8e3f7.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684737817373/d626e8d8-f7ee-438d-83c2-49212a038d03.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684737831970/d272609e-e108-4906-b3a4-4c34da2d8a51.png)
Edit Network Settings:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684737890773/8f914413-fdbb-416b-a8ba-7bdb0433455d.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738018109/3df2c01d-699a-4557-ae5e-1dd9f4153210.png)
Create Security Group:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738128494/66dd403b-d4db-43a7-a506-4438b67f4d57.png)
Rules will be configured later in the lab:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738230222/0c5aee8d-80d5-41fe-999a-00a7227ca405.png)
Launch Instance 1:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738262114/8a933376-7f64-498c-a369-f36c3f27a068.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738298504/859c1cbf-03b6-45db-a224-3c4963f83e79.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738314177/62180358-f4e5-4de1-85ab-d166a191c85b.png)
Note: Also create the instance-2 in the default VPC but in a different zone.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738455253/4de95c93-3c78-4c21-bfab-b7a176c9d250.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738527041/fe7b25c2-3776-404c-841b-d1460abb0d8e.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738585479/d4e7a35d-e2e5-4a38-af47-ae06c4659fbc.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684742117614/601f7b6a-d0d4-4b83-9a60-5b462f9cc0b1.png)
Verification:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684740447997/c352b45f-185f-4b59-a717-eca8852265c0.png)
Configure IIS Server in both EC2 Instances:
First Connect EC2 Instances:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738836526/3e82a4bf-cd04-4055-8eb8-97ca4960ba83.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738853533/388aafb0-921a-44b6-8618-d8aac7b7a487.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738869496/577a4c8d-c3c8-4a8f-af42-589c51fc8d55.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738924183/22dfc4bc-cecf-4c62-95de-13799649699b.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738952291/dfa0dbe0-5a33-401a-bd7e-c8c01c7845ba.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684738986852/a80ceff2-76f0-4778-a10b-1a761228aecd.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739005402/4c91c5df-a69a-4931-94a9-e000721ccb53.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739018074/3f7f592e-a72f-4233-80a9-b5c2a88502b9.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739099971/54f44505-b4a0-491c-bfe5-231ee9225b97.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739122047/69d9624b-1aa6-4d7f-ab5e-295a26a22968.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739163667/aeca1314-22ba-42c4-9fae-aa1244fd7ab6.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739250451/61307780-4ac5-4d19-9bca-7b61be0c3f35.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739386049/f2c2fd31-f0dc-47aa-86f5-001fe7c00668.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739443788/3c29e1ad-52b2-492a-b248-392b288a82d9.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739461777/b63976f9-c633-4f9c-9994-3f07f6238425.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739488180/67b101b4-077e-4bb1-b967-2001037565ec.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739514110/ded450c3-25eb-40cc-9d7b-bcc56bdcf43f.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739544043/8815fa35-1544-472d-a1bf-dd2d3cc9d2dd.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739611101/6f27a899-5bf1-4158-ac40-0b691600a2c8.png)
Create an index.html File In Both Instances:
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684739735709/9e07409b-f32b-4398-9ca9-5f64421957d9.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684740157970/5c5ac35a-006b-4ee0-a7cc-d82fba7e8648.png)
CONFIGURE NLB:
Choose the Private IP Address for the EC2 Instances.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746075725/81b405e6-bf69-4273-8447-c9d23ce0d510.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746104670/c338aed7-969c-42d2-bf81-29dc690af853.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746132217/f5c3fe08-1ed8-4db5-94d2-399391d118e6.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746149718/03d6c518-df0b-4144-9880-b2e036f5882e.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746176999/bf90c639-e612-47ec-8a91-4ecf25ae548a.png)
Configure default VPC.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746232114/c469e449-d695-4a18-9cd8-cb647b9c08e3.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746275461/3229565f-6be2-4cf2-996f-49d1b35ac11c.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746292906/43517ded-f2eb-4c2c-8c51-73d3f4758969.png)
Create Listener.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746343845/67f810fc-30ec-4fd2-b646-b06f82cd5f40.png)
Create a Target Group.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746378180/aefa2a6f-ffee-41e1-b421-c3dbfb35ba14.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746422046/bd51df85-0ca7-4a5d-ad4b-3a10c1146cd3.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746451515/fd213e8a-2326-4a3b-a09c-4578700a2c43.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746937924/c010194b-1474-4847-b189-297cda7e5d33.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746978702/1b79bfd7-f9db-4af5-8b7e-99581cf2cea1.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684746721159/732aaca3-2e71-4a96-9eb4-359bcf95ff18.png)
Switch back to the load balancer and configure the target group in NLM.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684747159374/8a56de44-f877-4825-8090-6832917c9a8d.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684747234983/3a6e5865-1900-4863-91a3-0b8ca6fa05ab.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684747269967/3020e473-14f9-4c09-8038-fc585de3619f.png)
NLB Verification.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684748437314/4ce8349f-941d-4dca-8377-2b5fad69eaf1.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684748457252/3bfd640b-ee1f-41c2-ad42-887f471baedb.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684748491312/4a87e639-542d-4706-a447-c024a361ae3b.png)
Use the DNS Name of the Load Balancer to connect.
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684748516136/788ba671-e672-4e31-9d60-5b50b292bdde.png)
![](https://cdn.hashnode.com/res/hashnode/image/upload/v1684748396094/c41e24ed-45ad-46d2-8793-fa5a841431ff.png)
No comments:
Post a Comment