In this demonstration we are now going to go about configuring a load balancer in Azure.
So let's head straight over to the Azure portal.
Okay.
And then the Azure portal just to set the stage for everything if we go over the virtual machines you'll
notice that I have three virtual machines for this demonstration.
I've got a jump box that I can order p into over a public IP address.
I've got two virtual machines SSL test VM 0 1 and SSL test VM 0 2.
Both of those victims are running a simple I.S. Web site.
So if I just going to say test VM 0 2 and I'll connect in the
and open it up and just type in H TTP local host you'll see that I'm on skylines VM 0 2 so in each VM
I've just got a basic Web page that's being served up and just identifies the virtual machine.
So we'll go back to the Azure portal and let's now go ahead and create our load balance.
So let's go to create a resource select network in select load balancer
and we first have to go about creating the front end portion of the load balancer so in my case I'm
going to call this cell dash internal because we're gonna create an internal load balancer dash L.B.
and I can select chat between public and internal so we're gonna choose internal.
But I mean just go back and show you public for the moment when I choose public I can choose a public
IP address.
This could be one I've already got created and can obviously be associated with another machine already
or another load balance already.
And if I want to I can just go in here and create a new public IP much much like I would any time I
created a public IP address but I'm going to do this internal for the moment let's hit internal and
when I do it as internal I get a choice of the network.
So I'm going to choose my vignette and I'm going to choose my subnet in this case when I choose subnet
a.
And you can see then I can choose how the IP address is assigned so I can choose to statically assign
the IP and just type it in this box or I can choose dynamic and Azure will assign one to the load balancer.
Then I've got my subscription and my resource group much like every other service we create so I'm going
to use a cell dash network my resource group and I'm deploying this in North Central.
So that's the front end portion of the load balance that I hit create and we'll fast forward while that
creates should take just under a minute for it to complete
and that's completed.
So we'll go to that resource.
And now I can start the back end portion of the load balancer so you can see the configuration screen
on the left hand side of our select front end IP configuration you'll see the IP that's been allocated
10 0 0 7 that's because we made it dynamic but now I can start configuring these three things underneath
the backend pools health probes and the low balance and rules and I'll do them in that order.
So start with back in pools and the first thing we need to do is click Add and give it a name so just
call this SL web backend.
And now I choose how I want to associate this so I can select this dropdown and I can associate it with
a single virtual machine or virtual machine scale set or in my case I'm going to choose an availability
set that I already have select that dropdown select Excel a stash web that's my availability set with
my two web servers running in it select that and now this is very important you need to add your target
network IP configuration so you don't need to do two of these one for each virtual machine so select
this box scroll down choose our target virtual machines I'll be number one first of all we can see it's
got one network interface and if you hit this dropdown select the IP and then we will select add again
and now we will do number two
select its IP
and go ahead and select.
Okay and that will now create that back and pool just hit refresh CSL web backend already that still
actually provision and so it's got one virtual machine and then now refresh again and then you can see
we have two virtual machines have expanded out both of those are running and are in the backend pool.
The next thing we need to do now is add our health probes which essentially monitor the virtual machines
and check they're healthy and available.
So let's go over to Health probes select add give it a name
and then choose the protocol that you wish to check for so in my case I'm actually going to just select
H TTP and then I could select port 80 give it a path but these parts are really important at the bottom
the interval is the amount of time between probe attempts in seconds so every five seconds it's going
to check health status and unhealthy threshold this is the number of failures that have to occur before
it considers the VM behind the load balancer unhealthy and will then take it out of the pool and that's
all there is to the probe go ahead and click Okay take about 30 seconds or so wait for this to update
before you go onto the next piece
okay.
And as you can see our probe is now there still updating so we'll just give that a few more seconds.
There we go.
And now we go over to load balancing rules so in load balancing rules this is where it all comes together.
Select add and now we give it a name.
We'll just call this cell L.B. rule and I can choose my Peavey visions four for six in this case we're
using version four.
But now I select my front end IP address in this case I choose that one I created previously 10 0 0
7.
I choose my protocols in my case I'm going to use port 80 and then I choose my back in port followed
by my back and pulls so in this case I'm using that back and pull that I created.
So where back end if I expand that out you can see that's the only one I've got there followed by my
health probe which is full port 80 TTP.
Now if we scroll down there's a few more settings for example session persistence.
This allows me to maintain session state based on either the client IP or the client IP combined with
the protocol in addition of my idle timeout out and finally floating IP.
This is really for sequel always on availability groups that you would use this.
But if I go ahead and select okay this is now going to update the load balancer configurations and then
we'll fast forward hands or we take about a minute okay.
And we can see that that load balancer rule was created successfully.
Let's go back to the overview and just grab our IP address in this case 10 0 0 7 and let's head over
to our jump box machine to test it out.
And so I'm just going to fast forward here as I order P to the jump box.
It's a VM in the exact same subnet as our test vans.
So we're now in the jump box itself and open up a web browser.
And if we type in 10 0 0 7 and you can see I got skylines VM 0 1 returned we refresh again didn't do
anything different.
I was trying to incognito window we'll do 10 0 0 7 again and you can see I did a refresh there.
Now I got skylines VM 0 2s it's put me on the second server and that is all there is to it.
Both of those VMS on now successfully in an availability set that we created previously when we built
the VM so they're highly available across two fault domains and they are successfully behind a load
balancer as well so traffic is being dispersed between both of them.
And with that this concludes this demonstration.