When thinking about high availability in the cloud on the networking side we have
several tools and we've dug into some of these already but today we want to
highlight one in particular High Availability means that to some degree
or other we're dealing with some kind of load balancing load balancing is where
we evenly distribute the incoming network traffic load across a back-end
set of resources and the purpose of this is to provide high availability as well
as determining that our back-end is healthy enough to receive that traffic
as well and if not take it out of the pool and then we can do some maintenance
to get it back up and running there was a continuation on our network
connectivity series we're gonna jump in today to the Azure Load Balancer I'm
Dean Cefola & this is the Azure Academy
The Azure Load Balancer is part
of the family of resources that are in the networking space and as you can see
here there are quite a lot of them the load balancer is focused in the delivery
space and much like the azure front door that we've already covered and we are
creating videos for the rest of these delivery resources so be sure that you
subscribe so you don't miss any of those now the Azure Load Balancer comes in a
few different flavors and we're gonna go over to the azure docks and check it out
over in the docs page in our table of contents we'll go to networking and then
go to the Azure Load Balancer and we'll click on this link for what is the azure
load balancer now the azure load balancer is a layer 4 resource and
that's a reference into the OSI model needs a way to think about this is if
you consider the post office the post office will inspect the outer packaging
to determine how it should be delivered but they're not going to delve deeply
into it and so layer 4 is where we can do transmit of basically any kind of
port and generally any protocol to get data from one place to another this is
different than what we cover it in our Azure front door video and I'll link
up here you can go check that out if you miss that whereas the front door
functions at layer 7 along with our application gateway we can pretty much
set any port that we want on our Azure load balancer and there's other features
and benefits that come along with that now you can see in
our graphic here as we scroll down that the load balancer can be used in a
public or internal manner so I could have it outside focused on two port 80
traffic coming in then internally switch that to something else most typically
you would see a load balancer used in something like a clustering type
solution like sequel cluster or a scale out file server doing something where
you don't see layer 7 at traffic or you don't need some of that deeper packet
inspection let's jump over to the azure portal and build ourselves a load
balancer it will click the plus up top to create a new resource and we'll type
the load balancer and we'll select that first one and then hit our create button
we need to put the load balancer into a resource group and I'll set up a new one
for this we'll just call that my load balancer and then we of course need to
give our load balancer a name and again I'll just call that my load balancer and
we'll put that in the east us region it will scroll down a little bit here and
now we can see our next choice is what type of load balancer we will create an
internal or a public one now you can see that by selecting public we have the
section for creating a public IP address but if we change to internal and those
go away and we will have only a IP address on our virtual network which we
can choose to be either static or dynamic then we have the option of
choosing which SKU we want and that is either basic or standard when we choose
standard we'll get a blue box here reminding us that we need a network
security group to allow traffic to our load balancer and we also have the
option at the bottom for using an azure availability zone and that would be
dependent on what region you are in as to how many zones you have and if there
are multiple zones then the load balancer can be zone redundant this time
around we're gonna create a public load balancer standard SKU and so we'll get a
new public IP address for this and that public IP address must also be standard
and we'll scroll down a little bit here and we'll select our availability zone
as zone redundant and hit next and I'll just add a cost center tag at the moment
and we'll hit next and then we'll hit the create button now while that's
creating we'll go right back to the plus and create another one and this one
we'll call internal load balancer again in the east you
our type will be internal or skew is standard and then we have to select what
virtual network we're going to put this on and I'll just choose my B net and put
it on the test subnet with a dynamic IP and we'll make it
zone redundant and we'll hit next we'll set the same cost code tag and hit next
and then we will create alright so we've got to load balancers provisioned our
public and our internal now let's dig into each config so in the public load
balancer at the very top we've got our standard Azure stuff telling you what
resource group locations subscription etc at it's in and over on the right
side here we've got the backend rule the health probe load balancing rules that
rules and our public IP address over on the left in the settings section we have
the front-end IP configuration and that shows here our public IP address our
back-end pool we don't currently have one yet we'll come back to building one
in a moment and then same thing for our health probes load balancing rules NAT
rules outbound rules etc so we have to configure all of these things in order
to make this work switching over to the internal load
balancer things look slightly different and see the main configuration set at
the top is the same but instead of a public IP now we have a private IP
address and over in the front-end IPS we see that same private IP again and we
still have to create our back-end pool health probe load balancer rules and net
rules back in the docs for a moment if we go to concepts in table of contents
and then go to components and limitations and over on the right side
we'll click load balancers SKU comparison but we saw that there were
different SKUs that we could deploy a standard and a basic SKU here's the
basic differences between the two in a basic load balancer we can have a
maximum of 300 resources in the back-end pool or with standard we can have up to
1,000 resources that could be your virtual machine or virtual machine
skillsets however one limitation there is that all of those machines that
you're putting into this load balancer back-end pool have to be in the same
virtual network availability zones are available
only within standard and one more that I want to get to here and that is a che
ports let's click on that link and talk more about this for a moment so what our
H a ports and why should we care so let's scroll down a little bit to why
use a che ports because there's a good diagram here to help us out when you
configure load balancing rules you have two basic choices you can choose to
configure these manually or you can do it more dynamically with a che ports
this is basically where we will say whatever ports come across on the load
balancer as you can see in the center here or one through 65,000 we're just
going to say whatever comes through balance it across the whole back-end
pool and that's very convenient especially if you're using some kind of
network virtual appliance for a firewall from another vendor and you're not sure
exactly what's going to come in but whatever it is comes in from the peers
over on the right is going to hit that load balancer pass down to the backend
pool and then that flow will be symmetric so that whichever node in the
pool picks up that flow it's going to continue that conversation with that
other system until that session is complete you know that we've walked
through the basic build of these load balancers I'm actually going to delete
them and we're gonna provision this all over again this time from a fully
configured solution so at the top here we'll click our search bar and we'll
type deploy and then we'll select deploy a custom template and at the bottom here
we've got load a github QuickStart template we'll click the little drop
down for that and I'll type the word internal and we want the second item
here two VMs with an internal load balancer and then we'll hit the Select
template button we'll deploy this to our my load balancer resource group and we
just need to give it a username and password and we can decide to change the
VM name prefix if we want to but I'll leave it alone it back-end VM and we're
ready to deploy this and we'll scroll down and check the box that says I agree
and we will hit the purchase button so starting with the bm's then go to the
networking and then we can see under the load balancing link which load balancer
we are attached to we can click on that to also take us into the load balancer
now notice our configuration this is an internal load balancer we do have a
back-end pool set up along with health probes a load balancing rule no NAT
rules at this point and we have our private IP so looking at the front-end
configuration we just have a single IP we can have multiple here and you could
do another one just by clicking add we'll give it a name of IOB IP - this
will be again on our b net that we already have set up we can't span
multiple V nets from one load balancer and we'll select the particular subnet
this case the back-end subnet and we'll leave our IP address dynamic can click
Add that'll provision us a new private IP
address on that subnet and that should be done in just a moment now while that
is going on let's look at our back-end pool and our pool we can see we have two
VMs in there right now we can hit the drop down to see what those VMs are if
we click on the line for the pool we can see the pools configuration and it can
be IP 4 or 6 we can associate this back-end pool to a virtual machine or a
virtual machine scale set let's create a new back-end pool real quick I'll just
call it back-end pool 2 and this will be unassociated at the moment we'll just
hit add and while that's going we've got our health probe and I've already added
a second probe here so here's what our original probe that came with the build
looks like you can set your interval for how often it will check the backend to
see if it is healthy and then if we find that 2 of those tests come back as a
failure the backend resource will be marked as failed - then all the traffic
would go to the other device and then we have the load balancing rules and it
uses our front-end IP address which protocol we select TCP or UDP the
particular front-end and back-end port and they do not have to be the same and
we select which back-end pool we want which health probe we want to use and
web we want to use session persistence
persistence has to do with what happens after the initial connection begins when
you have none selected that means that any machine in the back end and pick up
the next request so the first request comes in you talk to VM one second
request comes in you might talk to VM one or you may go to VM two the options
that you can choose from our clients IP and client IP us protocol so that means
if I have a client device and that comes from IP and dot one the next time that
that machine makes a connection within that same flow it'll talk to the same
back-end device I can be further specific by using IP and protocol and
say not only from 10.1 but 10.1 on port 8080 make sure that you talk to the same
VM so if n dot one talks to port 80 it may talk to a different VM then we have
the idle timeout and this is after that sessions flow has been initiated how
long do we wait for that flow to be idle before we mark that session as complete
we can close that off and then the next time the request comes in from 10.1 it
might go to VM - and then you'll start the process all over again and the last
option here is for floating IP and we'll come back to that in just a moment so
let's go back to the load balancing rules and let's create a new rule we'll
call this SMB and we'll use the same front-end and this will be the TCP
protocol will have this use port 4 4 5 going to the same back-end and we will
select our SMB health probe session persistence we'll set for client IP and
protocol and then we have that option for direct server return now if we go
over the tooltip here this is the feature that's generally recommended for
use with a sequel always-on availability group or a sequel failover clusters IP
and the purpose of it is that once you have initiated that original flow then
all subsequent traffic in that flow will not actually go through the load
balancer you'd be talking directly to the backend server ok so in this case
for just the simple I'll share I don't need it but be aware
that you do need to enable this when you build the low balancing rule go ahead
okay and that will create our load balancing rule force in just a moment
while it does let's go to our jump box and in our jump box will open up a new
web browser and we'll go to the IP address of our load balancers front-end
and when we do we are sent to the backend of VM because was this port 80
traffic and our back-end is currently healthy so here we are on the web server
the backend a sure we've gone into that VM and I'm gonna restart this VM and
we've refreshed the browser and now we're on VM one ideally though you don't
really care which one you end up on because both of the systems are in the
backend pool they should both be able to service all of your requests and now
we'll open the Windows File Explorer and we'll go to 10.0 2.6 and then we'll go
to the share folder and when we do we're directed to the share on back-end 1
because that's the one that we currently have a flow with back in Azure will
restart VM 1 now which will kill that session and I'll just press the f5 to
refresh our share screen here and now we're on VM zero back in our web browser
will refresh here as well and now we're back to VM zero back in the azure docks
is one more thing that I wanted to cover today and that's how do we upgrade from
a basic load balancer to a standard load balancers we can take advantage of
something like those HA Ports so in the filter box here on the right will type
upgrade and there are three options that show up based on which kind of
configuration you have whether this is a public load balancer or an internal load
balancer I'll choose the middle one here for no outbound connection and over on
the right side here we'll go to the download the script link and we can
download this from the PowerShell gallery and we'll copy the command and
this time we'll open vs code we just have to run the script with a few
different switches here our g name is where your current load balancer is
located and old lb name the name of your load balancer
I want this deployed into the same region which will be east US and I want
the load balancer to be called il be standard and I'll use the verbose
switch and press ENTER and it's going out and discovering everything about my
current load balancer going to create a new standard load balancer and then get
everything connected back in the azure portal we see our original load balancer
now next to our standard load balancer we'll click on the standard load
balancer here and we've got a new set of IPs and our front-end configuration same
thing goes for our back-end pools as well as our health probes and load
balancing rules so if we go to back into pool one and we select our VMs and their
IPS we see that we cannot do this because they are already associated with
another load balancer so in order to make the cut over there could it be some
downtime involved you can do this one at a time to avoid that downtime so we'll
go back to the original load balancer first into the back-end pool and we'll
delete our VMs from the pool and hit save and now that we've got that out of
here we can go back to the standard load balancers back-end
pool and now we can assign our VMS to this new back-end pool and you save so
let's go to our load balancing rules now currently we have these two rules so
let's just verify that they work back in our jump box will open a fresh web
browser and we'll go to our new front-end IP address and we'll hit enter
and we are back on our server and in our file explorer we'll go to the same
address back to our file share and there we go okay so we verified that our new
standard load balancer works now we want to set up those HA Ports and we'll take
our second load balancing rule here and we're going to delete it
since the HA Ports is going to balance everything across a load balancing rule
we don't need more than one so we'll go into our remaining rule and check the
box for h.a forts and hit save but we removed the load balancing rule for our
file share so let's start with that and we'll go right back to the share address
still works so let's go to our web page 10.0 2.9 and that works as well and
since we were connecting to box 0 we'll just bounce that box so we see that the
h8 ports does failover and will refresh our browser and now we're on box 1
and we'll go back to our file share and we'll just refresh that and there we go
we're back on box 1 so the H a ports allows us to have all the benefits of
the load balancing rules but spanning across every port making management a
lot easier and allowing us to scale I hope you've enjoyed this look at the
Azure Load Balancer this resource is really diverse and allows you to work
publicly or privately on your own virtual network with multiple kinds of
configurations including those H a ports which will make your life so much easier
in using this kind of tool and we've got many more videos coming on this network
delivery series so please subscribe so you don't miss any of that and if you
thought this video was good or you learned something new then give us a
thumbs up and let us know and while you're down there you can give us a
comment or some feedback on this video or other things you'd like to see the
azure academy produce we're just here to help you learn all about Azure and if
you'd like to get an email to notify you when our new videos come out which is
about once a week then you can go ahead and click that email notification icon
as well and if you're looking for something more you can go check out our
playlists or you can click over here on the top right this video is our latest
video or you can go to the one on the bottom and this is one that we selected
just for you to help you keep growing on your Azure journey thanks very much for
joining us today and we will catch you in the next video happy learning