Skip to playerSkip to main content
  • 6 days ago
Transcript
00:00welcome to this demo on OCI load balancer in this particular demo this is the scenario or the
00:10topology we are going to use so you see a vcn here with two subnets a public subnet and a
00:17private subnet and two web servers and these web servers are instantiated inside the private subnet
00:25meaning they don't have public ip address and that's okay because the load balancer is in the
00:30public subnet and these web servers act as backends to the load balancer so this is the setup we are
00:38going to run for this demo so let's get started the first thing we need to do is is to create a
00:46virtual cloud network so i'll click on networking click on virtual cloud network and bring up the
00:51vcn wizard to create the virtual cloud network so i can see there is no there are no networks here
00:56and i'm in the sandbox compartment so click on start vcn wizard and i'm going to use this particular
01:01setup vcn with internet connectivity so click on start vcn wizard let's provide a name for the vcn
01:09so let's say this is my load balancer vcn and uh sandbox compartment is fine and it's giving me a
01:20cider block for the vcn and the subnets i'm okay with these cider blocks and i'll go hit next and
01:26and click create and now my vcn will get created now one thing if you recall from the diagram we need
01:32to do is to modify the security list because we need to add a rule in the security list which will allow
01:39traffic on port 80 because that's where the web servers are running on those compute instances
01:45so i i'll come here and then i'll hit uh security list for this one and the default security list
01:54is the one which is used for uh with the public subnets i'll click on default security list here
02:00and you can see it has these ingress rules right now so there's traffic on port 22 which is allowed
02:06and there are a couple of icmp traffic uh rules which are there so i'll click on add ingress rule and i'll
02:12i'll say for the source i have acquired zero ip address meaning traffic coming from all networks
02:19all ip addresses and the destination port is port 80. so click that and then i'll add this ingress rule
02:26so now we have modified the the security list to allow traffic to come to port 80. so the next step for
02:32us is to go ahead and create a couple of compute instances web servers where we will install apache
02:40and these will act as backends to the load balancer so i'll click on the navigation menu and click on
02:48compute and i'll go ahead and instantiate a couple of instances which will act as the the the back end
02:56for the load balancer so the it gives me a default name i'll say this is my web server one
03:02sandbox compartment is fine okay with all the availability domains all these options image and shape look okay
03:09and right here under networking it picks up the load balancer uh vcn we just created but instead of
03:16putting this in a public subnet we are going to choose private subnet and remember this will ensure
03:21that these web servers don't get a public ipv4 address and we are also not going to ssh into these
03:27machines so we'll say no ssh is is is fine here and then right below under advanced options we have an
03:36option to provide a startup script so we'll just put the startup script here and the startup script
03:41is pretty straightforward it's a bash script it's basically uh installing apache and it's saying
03:47that you know it's giving some uh changing the home page saying that you know i'm web server one or
03:52something right uh and you can read more on you know what startup scripts do so i'll click create here
03:58with these options and my instance will uh will get created as the first instance is getting created
04:04let's go ahead and create another instance which will be my web server two so i'll click on create
04:11instance and we'll call this web server two all the default options look good for networking we will
04:18again choose a private subnet and basically this will mean that okay let me just
04:34all right so private subnet it will ensure that you know they don't get a public ipv4 address
04:39click no ssh and and right here like web server one will provide a startup script
04:49but this time we will change this to say web server two
04:54just making sure all the options look good there's still private subnet here load balancer
05:01and web server 2 is fine so hit create and this would take literally a few seconds 20 25 seconds
05:09and both my web servers will be up and running and as soon as the web servers are up and running we'll go
05:15ahead and provision a load balancer and put these uh web servers as back end to the to the load balancer
05:22so if i click instance here i can see that the web servers are one web server is already running and the
05:28second web server is getting provision so as this is happening let's go ahead and click on networking
05:34and click on on load balancer here and hopefully by the time we hit creating the load balancer those web
05:40servers are up and running so you can see here there are no load balancer so i can click on
05:45create load balancer and it gives me option to create a layer 4 load balancer also referred to
05:51as network load balancer or a layer 7 load balancer so i'm okay with creating a layer 7 load balancer so
05:58click on that and click on create load balancer and here it's a workflow which again it's quite simple
06:05it just walks you through the steps required to create a load balancer so we're interested in
06:10creating a public load balancer we'll have an ephemeral ip address under the bandwidth just choose
06:16the default options which are provided here and for the network it's important now we pick the public
06:22subnet because the load balancer is actually instantiated in the public subnet so this looks fine
06:30click next and for the load balancer algorithm there are multiple options so there is weighted
06:37round robin there is ip hash and least connections in our case we will choose weighted round robin and
06:43basically what this means is the policy distributes incoming traffic sequentially to each server in in
06:50a backend set list so right here is the place where we add the backends and click on add backends and
06:56here you can see both web server one and web server two are running so i'll just click on them and add
07:03them as backends and and that's it right my backends are added and if you scroll down all these default
07:10values i'm just going to leave them as is so basically this is saying that we are performing some
07:16health check to confirm the availability of backend servers and the health check is performed using sttp
07:22protocol at port 80 that's where my web server is running so all this looks good click next and the
07:29last step is to configure a listener listener is a logical entity that checks for incoming traffic on
07:35the load balancer's public ip address because we are running a web server so we are going to use sttp
07:42and we are going to use port 80 right so that's uh that's the the value we are going to use and uh we're
07:48going to uh it's kind of a basic demo so we are going to disable any kind of logging here and i'll
07:54hit submit and literally again this would take uh less than a minute and the load balancer would be up
08:02and running and once the load balancer is up and running we'll test it and one thing to note would be
08:09once right now you see the backend set health as pending because it is instantiating uh the load balancer
08:16it's pinging the back end once all the setup is complete you will see that this status will change
08:23from pending uh to okay and the color will change to green so let me hit pause here give it a couple
08:29of minutes or less than a minute and come back and the load balancer would be up and running
08:34and as you can see here it took literally 30 seconds or so and the load balancer is up and running
08:40and now the the backend set health is also turned green it says okay and i can pick this uh public
08:46ip address and paste it in my browser window and bring up the backend sets uh the backends we just
08:54provision so it says you know connection is not secure of course we did http and right here you can
09:00see it says uh let me zoom zoom in a little bit more you can see it says uh hello world my name is
09:06uh web server 2. if i refresh the browser again it says web server 1 web server 2 web server 1 web server
09:142. so this is weighted round robin in action and you can uh get a lot of information about the load
09:20balancer all the matrix the backend set health check etc all this there's a lot of advanced functionality
09:26there so this is how simple it is to create a load balancer we created one with two backend sets uh
09:34it's quite straightforward process so hope you found this demo useful thanks for watching
Be the first to comment
Add your comment

Recommended