Microsoft Azure

Load balancing and high availability using Azure Load Balancer between two virtual machines (Part 4: Enabling web server role in Azure virtual machines and execution of failover tests)

Enabling Web Server Role in virtual machines

  1. Enter via the RDP protocol to the vm-vvillar virtual machine opening a remote desktop and typing <the public IP of the load balancer>:5000
  2. Click on Use a different account and type the credentials of our virtual machine
  3. Click on yes in the certificate that will appear and we will have access via remote desktop to the vm-vvillar virtual machine
  4. Dar click en Add Roles and Features dentro del Server Manager, en la parte de Server Roles dar click en el cuadro de Web Server (IIS) y en la ventana emergente dar click en Add Features
  5. Leave everything else by default and click on Install
  6. Once the web server role is installed in the vm-vvillar virtual machine, we will modify the html file that comes by default to add a phrase and identify that it is the virtual machine 1. To do this, go to C:\inetpub\wwwroot , open a Notepad and drag the file iistart.html to the Notepad
  7. Under the label <body> insert the following code
    <h1> Server 01 </h1>
    Save and close the Notepad
  8. Do the test entering by the public IP of the virtual machine through a browser
  9. Repeat the same procedure for the virtual machine vm-vvillar2 accessing through the public IP of the balancer and port 5001 on a remote desktop
  10. Accept the certificate and then perform, as in the previous virtual machine, the enabling of the Web Server (IIS) role and configure the HTML file with the code
    <h1> Server 02 </h1>

Access to the websites through the load balancer and execution of failover tests

  1. UOnce the role of web server is implemented in both virtual machines, we will proceed to enter through a browser using the public IP of the Load Balancer (52.188.218.176 in my case). We see that the load balancer is redirecting us to website 01.
  2. To do the failover tests, we will turn off the server so that when we access again the IP of the load balancer, it will take us to the website of the other virtual machine.
  3. Entering with the IP of the load balancer, we see that it now takes us to the website of the other virtual machine.
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments