Create Azure Web Farm using Load Balancer and High Availability Set
In this blog, we will show you the steps to Create Azure Web Farm using Load Balancer and High Availability Set.
- Azure Subscription
- 3 Azure VMs.
- The POC network for this demo is shown above.
- We need to configure the Virtual Network, Availability Set (AS), NSG (Network Security Group) and internet facing ELB (External Load Balancer).
- Log in to the Azure portal using your subscription.
- Click on Virtual Networks link from services list.
- We created a new virtual network named Virtual-Network-arm with network 192.168.0.0/16.
- Also, we have created two subnets named Web-Tier-Subnet and Data-Tier-Subnet. The address range is 192.168.8.0/24 for web-tier-subnet and 192.168.9.0/24 for data-tier-subnet.
Note: We created Data-Tier-Subnet for future use. Not for this demo.
Note : We are using the traditional storage account instead of managed disk for this demo.
- From the Azure dashboard, click on Storage accounts from services link.
- We created two storage accounts named webtierstorage01 and datatierstorage01.
- We created the datatierstorage01 storage account for web-tier VM’s to store their VHDs.
- For more information, please check the URL https://blog.assistanz.com/steps-to-create-a-vm-in-microsoft-azure/ to create a storage account in detail.
- From the Azure portal homepage, click on more services link from the services list.
- Type availability set in the search bar.
- Also, you can click on the star icon to make the service available in the homepage service list.
- Click on Add button to create a new availability set.
- Provide the name for this availability set and select the existing subscription, resource group, and location. Set the fault domains and update domains as 2. Select the Classic option to use the traditional storage type. Then click Create.
Note: For more information about fault domains and update domains. Please check the URL https://blogs.msdn.microsoft.com/plankytronixx/2015/05/01/azure-exam-prep-fault-domains-and-update-domains/
- The new availability set will be available on the list.
NETWORK SECURITY GROUP
- Select the NSG from the services search option.
- We have created 2 security groups for this demo. They are Jump-box and web-tier.
- We have added the RDP and HTTP as inbound security rule for the web-tier group.
- For Jump-box group, we add only the RDP port as inbound security rule.
- From the Azure portal home page click on Virtual machines link from services list.
- Click on Add button to create new virtual machine and we select windows 2016 image for this demo.
- While creating the VM, make sure that you have selected the corresponding Availability set, Storage Type, Storage account, virtual network, Subnet, Network security group.
- Make sure that you have selected the public IP address as none. We are using the jump box VM to connect these internal VMs.
- Also, we have disabled the Boot Diagnostics option for this demo.
- We have created two web server VM’s using the above steps.
- Also, we created a Jump-box VM with Windows 2012 OS and public IP to connect the web-tier VMs.
FINDING WEB-TIER VM INTERNAL IPs
- Click on Virtual Networks from the Azure service list. Then click on the virtual network.
- You can find the internal VM IP’s under connected devices.
INSTALLING AND CONFIGURING IIS SERVICE
- We have connected the web-tier VMs through jump-box and installed IIS services in it.
- We have placed a simple HTML page on both web servers.
CONFIGURING EXTERNAL LOAD BALANCER
- Click on the Load balancers link from the service list.
- Click on the Add button to create the new load balancer.
- Provide a name for the load balancer and select the IP type as Public.
- We have already created a public address group for the load balancer. We used it. For more information about creating new public addresses group, please check the URL https://blog.assistanz.com/steps-to-create-a-vm-in-microsoft-azure/
- Select the subscription, resource group, location and click on Create button.
- Click on the newly created load balancer and select Backend Pools.
- Click on Add button.
- Provide a name, and select the Availability set from the drop-down list under Associated.
- Click on the Add a target network IP configuration and add the each VM one by one. Then click OK.
- Once the new load balancer backend pool created, click on it. Follow the same step to add the second VM in the list.
- Now the two VMs available in the list.
- Click on Health Probes link and select add button.
- Provide a name and port number to monitor the health. For this demo, we add port 80 for monitoring.
- Click on Load balancing rules and select Add.
- Provide a name for this rule and select IP version & Frontend IP address. Select the protocol as TCP. Add the external port and back-end ports. In this demo, we add both ports as 80. Leave the other option by default and click OK.
- Select the Overview link to find the load balancer public IP address.
- Open the web-browser and access the load balancer IP.
- Hit ctrl+F5 to reload the page and you will access the VM 02 webpage.
Thanks for reading this blog. We hope it was useful for you to learn to create a web farm in Microsoft Azure.