AWS/Azure/OpenShift Network

How To Set Up Public Load Balancer in Azure Step By Step

azure-resource-groups-1

In this article, I will show you how to set up a public load balancer in Azure. Where it can distribute the incoming traffic over multiple servers. It will split up the load over two Virtual Machines. IPAM enables the administration and monitoring of DHCP and DNS, and provides a comprehensive view of where IP addresses are used, it also collects information from domain controllers and Network Policy Servers (NPSs), and then stores that information in the Windows Internal Database. Also here are some of my related guides: How to configure Network Load Balancing (NLB), how to create a load balancer for Azure Stack Hub, how to deploy a load balancer from scratch and adding backend servers, how to use Aws to deploy, schedule and run playbooks, how to configure azure resources with tools, how to install and configure Ansible on Ubuntu, how to install Kerberos packages in Windows via Cygwin and how to deploy Azure VMware solution private cloud.

Create Virtual Machines

We’ll create VMs in each virtual network (VNet) so that we can communicate between them.

Let Create 1st VM

  • On the Azure Portal menu tab, select Virtual machines
Capture-38
  • Select the + Create button to create virtual machine.
Capture-39
  • From the Resource group section, select create new.
Capture-74
  • Type resource group name (rg-web) and then click OK
Capture-41

Instance details
Enter a virtual machine name (web1)
Region select (East US)
Availability options – select Availability set.
Availability set select to create new.

Capture-42
  • Enter a Availability set name loadbalanceset and then click OK
Capture-43
  • Image select Windows Server 2019 Datacenter.
  • You can select a various operating system, but the remaining steps assume you selected Windows Server 2019 Datacenter.
Capture-44

Administrator account
Enter a username, Password for your account.
Public inbound ports choose to allow selected ports.
Select inbound ports (HTTP, HTTPS, RDP) and then click on Review + create >

Capture-45

Select create

Capture-46
  • Your deployment is complete
Capture-47

Create the second Virtual Machine

Complete by creating the second VM by the using the following changes below:


Name: Value
Resource group: rg-web
Virtual machine name: web2
Region: (US) West US
Availability options: Availability set
Availability set: loadbalanceset
Image: Windows Server 2019 Datacenter
Administrator account: username & password
Public inbound port: allow selected ports
Select inbound ports: HTTP, HTTPS, RDP
Click Create
  • The Virtual Machines take a few minutes to create. Now we have created the both Virtual Machines (web1, web2) successfully.
Capture-48

Create Network Load Balancer

  • From the Microsoft Azure menu, select Load Balancers
Capture-49
  • Select create load balancer
Capture-50
  • Select resource group rg-web
Capture-51
  • Enter the name of Load Balancer.
  • Select Region (East US).
  • keep it Public and SKU Basic.
  • Set the Public Address.
  • Create new, enter a name lbpublicip keep it dynamic and then select Review + create >
Capture-52
  • Validation Passes
  • Click on Create
Capture-53

Now you can see load balancer successfully created, click on lbweb

Capture-54

Here, I will be configuring the Health Probes for our Load Balancer. So, we can specify how many servers we want to make the Load Balancer.
In the Backend Pools, we specify the servers which we are going to use in the Load Balancer.

Backend Pools

  • Click on Backend Pools and then click on + Add
Capture-55
  • Add backend pool wizard, Type a name
  • Virtual network (rg-web)
  • Associate to select virtual machines and then click the add button under a virtual machine.
Capture-56
  • Then Add virtual machine to backend pool wizard
  • Select the VMs and then click add.
Capture-58
  • After selecting the VMs, then click on i.
Capture-59
  • The backend pool has been configured successfully.
  • Inside Load Balancer, go to Health Probes
Capture-60
  • Click on Add
Capture-61
  • Enter a name to the Health Probe.
  • Protocol (HTTP)

NOTE: The interval shows that it is going to make a probing attempt at 5-second intervals. The unhealthy threshold shows that after 2 attempts failed probe, it is going to declare it as an unhealthy server. Click ok

Capture-62
  • Health probe successfully created, click on Load Balancing Rules.
Capture-63
  • Click on + Add button
Capture-64
  • Add load balancing rule wizard, The IP version is IPv4
  • Select frontend IP Address
  • The protocol is TCP, the port number is 80
  • Backend port is 80, the backend pool is the one that we have just created and the health probe is the one that we have created.
  • Session persistence is by default – None
  • Idle timeout is by default – 4 minutes.
  • Floating IP disabled. Click on OK.
Capture-65
  • Load Balancing Rule has been created.
Capture-66

Test Network Load Balancer

  • After remoting to the both VMs.
  • Right-click, select new and then click text documents\ on each VM and then delete these files.
Capture-67
  • Open the text file
Capture-68
  • Type this is windows server web1
  • Select file and then save as.
Capture-69
  • Type index.html Save as type All Files and click save.
Capture-70
  • Select Azure menu and then load balancers.
Capture-71
  • Click on load balancer lbweb
Capture-72

In the Load Balancer, Copy and paste your Public IP address, then paste it in the explorer address bar.

Capture-73
  • On the first hit, it has takes me to web1 server, then wait for some minutes again press enter key and it will open web2 server just as it is shown below.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Kindly subscribe to TechDirectArchive
This is default text for notification bar