Sharon demonstrates how to configure an Internet load balancer to distribute traffic to front-end servers, setup health probes, load balancing rules and NAT.
- [Instructor] Now that we've gone through an overview of Azure load balancers, let's go ahead and actually configure them. I've logged into Azure. I'm in a resource group that I've called LoadBalancing. Within this resource group, you'll notice that I have five virtual machines. I have three web-based virtual machines and two database machines. All the associated services for these VMs have also been created. I took all of the defaults, nothing fancy here. What I did add were two availability sets. I created a frontend availability set and then a backend availability set, and I configured the virtual machines within each of these availability sets.
The frontend contains the web servers. The backend contains the database servers. Our next step is to go ahead and add in the load balancer. To do so, I'm going to click Add. I'm going to search it, and there it is Load Balancer, and then Load Balancer. I want to go ahead and create it. I'm going to provide a name, and you'll notice that we have the two types. We have a Public and an Internal. For the most part, these will be configured the same way. The difference being in the Public, we must have a public IP address, so we'll have to go ahead and assign one or create one. In the Internal, we'll have to choose a virtual network and then choose a subnet where we're directing that traffic to.
That's really the difference between the two. For our demonstration today, I'm going go ahead and choose my public IP address. I do have one public IP address available within the east US region. I'm not going to use that one. I want to go ahead and create a new one. And I have the choice of creating a Dynamic or Static IP. I'm going to go ahead and use Dynamic. And then I'm going to go ahead and click Create. This will take a few moments. Once your deployment has succeeded, you can go ahead and actually configure that load balancer. I'm going to close this blade, and then one more. I'm going to go ahead and refresh my Resource group to ensure we can see the load balancer now.
I have to scroll down, I've just ordered mine based on type, and there's my load balancer. And now we can go ahead and start configuring it. First thing we need to do is add in our backend pools. Now remember, this is the internet load balancer. Therefore my backend pools are actually going to be my web servers. I'm going to go ahead and provide a name, and then I'm going to go ahead and add a virtual machine. This is somewhat deceiving when it says add a virtual machine. We're actually going to add an availability set, which has multiple virtual machines. If you had not configured your virtual machines in an availability set, and you wanted to add in individual machines, you would click on None.
Because Azure implementation is all about planning, I had already thought about putting my virtual machines within an availability set and created those availability sets right after I created the virtual network. Again, planning is the key. Next, you're going to go ahead and choose your virtual machines. You may not want all the virtual machines that are in that availability set. I'm going to take all three web servers, click Select, click OK. If I wanted to add another virtual machine, I could easily do so.
Otherwise, click OK. This will take a few moment to update. As we can see, our load balancer has saved our backend pool now, and we can continue along. Next, we're going to go ahead and create our Health probes. I'm going to go ahead and Add. I'm going to provide a name. I'm going to take my protocol, so I can do either TCP or HTTP. I'm going to provide the port, the path. I'm just going to leave this here as the root. How often do I want this to probe? Right now it's at every five seconds. Let's do it maybe every 15.
And finally, how many consecutive failures before we deem the virtual machine unhealthy. I'm going to leave it as two and click OK. This will take a moment to update, and our probe has been created. Next, we're going to add in our load balancing roles. Again, click Add. Provide a name. My frontend IP address will already have defaulted 'cause I've already configured it. And again, I have the option here of choosing my protocol. So I have TCP, RUDP. I'm going to stay with the TCP. I'm leaving the default ports of a 80. You could change these as required to meet your needs.
The backend pool is already selected for us since I've already gone ahead and created it. Our health probe is already selected for us because I've already gone ahead and created it. Session persistence is guaranteeing that the client will always connect to the same virtual machine instance during the session. So you can force it for Client IP or Client IP and protocol. I'm going to leave it as None. You can adjust that idle timeout, which is the amount of time to keep the session alive without waiting for the client to send a keep alive message. And finally, we have that floating IP or direct server return.
Basically, it disables NAT. We only enable this when configuring a SQL AlwaysOn availability group listener. Otherwise, leave it as disabled, and then click OK. This will take a few moments to save. Our load balancer role has now been saved. I can finally configure NAT. You may or may not have a NAT rule. It will be up to you. I'm going to go ahead and show you how to configure one, and then click Add. It's going to be for RDP, so anything that comes off my frontend load balancer if it is RDP traffic, it will be directed to a specific virtual machine.
And let's say I'm going to use Web3 for this. And then I'm going to leave my default port mappings, but I could go ahead and change these if I wanted to do that, and click OK. And this will take a moment to update. And our NAT rule has now been saved. As you can see, setting up these load balancers is very easy to do. The trick is, as with everything in Azure, planning. I had already configured my virtual machines into my availability set. I had already thought about my public IPs. Did I have one, did I need to create one? Using the Azure load balancers will create that highly available environment for your users.
- Creating an Azure virtual network
- Creating a virtual network using PowerShell
- Deploying a VM into a virtual network
- Modifying IP addresses
- Working with Azure DNS
- Configuring NSGs
- Setting up load balancers
- Configuring Azure load balancers
- Creating an application gateway
- Setting up on-premises connectivity
- Adding gateway VPNs
- Validating VPN devices
- Configuring VNet
- Creating site connections