Amazon EC2 High Availability and Scalability AWS | Shikhar Verma | Skillshare

Playback Speed


  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x

Amazon EC2 High Availability and Scalability AWS

teacher avatar Shikhar Verma, Solution Architect

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Watch this class and thousands more

Get unlimited access to every class
Taught by industry leaders & working professionals
Topics include illustration, design, photography, and more

Lessons in This Class

18 Lessons (1h 20m)
    • 1. Introuduction about course module

      2:35
    • 2. Overview of High Availability & Scalability

      5:26
    • 3. About Elastic Load Balancer

      3:16
    • 4. Classic load balancer (CLB)

      2:16
    • 5. Application Load Balancer (ALB) - Host & Path based routing

      5:42
    • 6. Network Load Balancer (NLB) Overview

      1:55
    • 7. Lab - Configure CLB

      9:31
    • 8. Troubleshooting - CLB

      2:18
    • 9. Load Balancer Stickiness

      2:39
    • 10. Monitoring of Load Balancer

      4:13
    • 11. Access logs of Load Balancer

      2:46
    • 12. Lab - Configure ALB

      6:56
    • 13. Lab - Configure Path Based Routing (ALB)

      8:37
    • 14. AWS Auto Scaling Overview

      5:05
    • 15. Auto Scaling Group & Configuration - Lab

      9:19
    • 16. ASG Policy - Increase Group Size

      4:26
    • 17. ASG Policy - Decrease Group Size

      2:37
    • 18. Last Lecture

      0:29
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

23

Students

--

Projects

About This Class

Learning is important but most important is how to explore it. This course is designed in such a way that you can learn as well as explore the entire course module with various practice lab sessions.

I am pretty sure that you might have heard about AWS being one of the highest paying job roles in today's industry, If yes, then what are you waiting for ? Add AWS to your skill set and get a boost in your career.

It covers in depth all the new topics on the AWS Elastic Load Balancer & Auto Scaling

It's packed with practical knowledge on how to use AWS inside and out as a solutions architect.

No programming knowledge needed and no prior AWS experience required.

Amazon Elastic Load Balancer

  • Overview of Amazon Elastic Load Balancer

  • Types of Elastic Load Balancers

  • Classic Load Balancer (CLB)

  • Application Load Balancer (ALB)

  • Network Load Balancer (NLB)

  • Path-Based Routing

  • Overview of AWS Auto Scaling

  • Auto Scaling Group & Configuration - Lab

  • ASG Policy - Increase Group Size

  • ASG Policy - Decrease Group Size

  • Practice Lab Session

Meet Your Teacher

Teacher Profile Image

Shikhar Verma

Solution Architect

Teacher

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

Transcripts

1. Introuduction about course module: Welcome to my new course module, Amazon EC2, high availability and scalability. My name is Chicago Wilma, and I'm the instructor of this course module. I'm having 13 years of IT industry experience and also a professional IT chain error. My passion is to create online, job oriented and satisfied courses. I had been teaching over to 25 thousand students online. So let's have a look on prerequisite of this course module. Pc or laptop with internet connection. Basic computer knowledge, basic English understanding. No previous knowledge of any programming or operating system is required. You will be guided a step-by-step from the beginning and gradually makes you comfortable and understanding the concepts of high availability and scalability. So let's have a discussion what you're going to achieve from this course module. So here we have, so we'll start with an introduction about scalability and high availability. And then we will discuss about an overview of Amazon elastic load balancer. And then we'll have a look on types of elastic load balancer, like classic load balancer, application load balancer and network load balancer. And also will show you how to configure classic load balancer. That is a practical limitation we have here. Troubleshooting also. Load balancer stickiness, monitoring off load balancer, access locks off load balancer. And then we'll have a lecture on how to configure the application load balancer. How to configure the pot days routing. That is a feature of your application load balancer. Overview of AWS, auto-scaling, auto scaling, group and configuration. So that is a lab session here is D policy that is Increased group size and decrease group size. So you can see that this entire course module is designed in a such a way that you can learn as well as explored the entire course module with various lab session. I'm pretty sure that you might have heard that AWS being one of the highest paying jobs roles in today's industry. If he is, then what are you waiting for? An AWS to your skill set and get boost your carrier. Thank you. 2. Overview of High Availability & Scalability: In this section, I'm going to discuss about Amazon elastic load balancer. Here it is one of the important section of this course module. Before to proceed this topic, I want to discuss few important terminologies like scalability, what typically scalability and horizontal scalability. And also will discuss about high availability. If you are already aware of it, you can skip this. Scalability. It refers to the idea of a system in which every application or piece of infrastructure can be expanded to handle increased load. Suppose I have an application. Initially, the application is running on T2 dot micro instance. The Lord on my application is increasing. So up to some extent, the instance we're able to handle the load of application, but the load is keep on increasing. There will be a point after that. The instance we're not able to handle, the lower. Your application is going to be crest. To solution is you can use the feature of scalability. You can increase the size of the instance, or you can add another instance to handle the load of the application. Two types of scalability. The first one is your vertical scalability, and the second one is your horizontal scalability. That is also called elasticity. So let's discuss both of them one-by-one. What to Kelly, scalability means increasing the size of the instance. Suppose I have an application which is running on T2 dot micro, and the load of my application is increasing. So I can increase the size of my instance from T2 dot micro, T2, T2 dot x large. So that is called vertical scalability. Examples of vertical scalability or database like RDS and elastic cache. But there is some hardware limit. And it is applicable only for non distributed systems. The next is your horizontal scalability. It means increasing the number of instances or systems for your application as per the requirement. Suppose I have an application initially, that application is running on T2 dot micro instance, but the load of my application is increasing. So what I can do, I can increase the number of instances. By one more instance. Leah, I was having only one system to handle the load of application. Now I have two systems. So you can increase the number of instances as per the requirement. Suppose the load is increasing further on the application, you can add one more instance. So that is called horizontal scalability. Horizontally scaling implies on distributed systems. And this is very common for web applications and modern applications. The next topic is high availability. High available systems are reliable in the sense that they continue operating even Van, critical components fail. There are also a resilient, meaning that they are able to simply handle failure of adult service interruption or data laws and seamlessly recover from such failures. So that's why it is called HIV liability. Your application would always be of level. If you have any failures on the system. High availability means running your application systems in at least two systems or at two data centers. The heritability can be passive or active. So let's understand it with a diagram. Suppose I have an application which is running on two data center, data center, one which is in New Delhi. I have another data center which is in Bangor location and application, which is running on two systems. And both the systems are in sync. One system is placed on New Delhi, another system is on Bangla. And the users who are accessing the application that traffic is distributing. Few traffic is going to New Delhi and few traffic is going to your bank loan that we'll discuss later. Suppose my data center, which has a New Delhi got crest. There is some network issue. So in that case, the user is still able to access the application because our application is still live from Bangalore data center. All the users still they can access the application from second data center. So that is called high availability. So that's all. 3. About Elastic Load Balancer: In this lecture, I will discuss about elastic load balancer. Amazon EOB allows you to make your applications highly available by using health checks and distributing traffic across a number of instances. You'll be helps to distribute the application traffic to various different targets such as EC2 instances. The weekend targets which are ready to collect the tariff rate are monitored by Amazon, ALB, whether they are healthy or not. And the traffic is sent to the healthy one. It is integrated with many AWS offerings and services. So this is the simple definition of LV. So we'll understand with a diagram as well. So here you can see a half a website. And initially that website is running on single T2 dash micro instance. And after some time, I have created one blob on my website, and that block got viral. That request on the website has been increased drastically. Thousands of request are started coming on my website. So in that case, t2 desk micro instance is not able to handle the load of the website. So what you can do, you can use the feature of scalability and he can increase the size of your instance. Now you can see I have increased the size of my instance from T2 desk micro to M5 desk large. That instance is able to handle the load, but that is not economical. It is going to charge a lot of fun you. So the best approaches, elastic load balancer. Amazon elastic load balancer, allows you to make your applications highly available by using health checks and distributing traffic across a number of instances. So here you can see a 3.5 instances for my website. And all the clean stances are in sync. Whatever we have on instance number one, the same is on step number two, and same on instance number three as well. All are in sync. And before T2 instance a hub, this elastic load balancer. So the request first coming to my elastic load balancer. And then elastic load balancer is going to distribute the traffic. Suppose a 100 request is coming to my elastic load balancer. So it is going to distribute the request among all the three instances equally. So the benefit is the traffic is distributing, the load balancing is going on, as well as suppose any of my instance. As down. Still we have two instances who can handle the request. So that's why ALB is important if you have such type of environment. So that's all we'll see in the next lecture. 4. Classic load balancer (CLB): In this lecture, I'm going to discuss about types of elastic load balancer. So the first one is classic load balancer, CNV. This is the previous generation load balancer that was used for EC2 classic instances. It operates on both the request level and connection level, but it doesn't support features like host based routing, our path they starting these advanced features has been introduced with application load balancer. That is the next type of your load balancer. Once configured, it distributes the load across all the registered instances regardless of what is present on the servers. Hence, it can only be used to distribute traffic to a single URL. Clv are deprecated because they are the previous generation load balancer. So let's understand what this diagram. So here you can see this is the elastic load balancer, which is in front of your instances. I have three instances at the backend and in the front end we have the elastic load balancer. So once you configured it, you will have one URL of this elastic load balancer. And that is the single point of contact for your instances. So the client, whenever they need to access the instances, they have to, you know, go with the elastic load balancer. And once the request is coming to the elastic load balancer, it is going to distribute among all the instances. And one more features we have here, suppose one of my instance is not healthy. Some hardware issue, it is not responding. So this elastic load balancer will check those instances which is not responding. And it is going to isolate the instance from the elastic load balancer. So the request which is coming to the elastic load balancer is going to distribute only those servers which are healthy. So that's all the discuss application load balancer in the next lecture. 5. Application Load Balancer (ALB) - Host & Path based routing: Next type of elastic load balancer is application load balancer, ALB. This load balancer is especially designed for web applications with HTTP and HTTPS traffic. There is a networking model called the OSI model that is basically used to explain how computer network walks. This model has seven layer and the top layer is your application layer. This load balancer works at this application layer. It also provides advanced routing features such as host based and part based on chain, that we'll understand in this lecture. It is also used for load balancing to multiple applications on the same machine, which is basically not possible with classic load balancer. With classic load balancer, you can route the traffic for a single of website or application. But suppose you have multiple application which is hosted on multiple instances. So with a single application load balancer, you can route your traffic. Lower is. Once I am going to discuss with a figure, then you can understand, basically, they are awesome for microservices and container-based application. For example, Docker and Amazon ECS. So advanced feature of application load balancer is host based shouting in part based auditing. Less understand host based halting that this diagram. So here you can see I have two different website, abc.com and X, Y, Z.com. And both the website is hosted on different instances. So first two instances is being used for ABC.com, and last two instances is being used for XYZ.com. And here you can see I have a single application load balancer, which can be used to distribute the traffic among the instances based on host. Suppose this user is typing in the browser abc.com. So the request will come to the application load balancer. And this application load balancer is going to, you know, forward that traffic to these two instances because abc.com is being handled by these two instances. Suppose ten request is coming for ABC.com to this application load balancer. So what will happen this application load balancer is going to forward all the ten request to these two instances and also going to distribute the request equally between these two instances. Now, suppose this user is typing XYZ.com. So the request again is coming to the same application load balanced cell, this one, this application load balancer is smart enough. He knows that if the request is coming for X, Y, Zed.com, it needs to be transferred to these two instances. That is for x, y, z, dotcom. So this application load balancer is doing two things. First, it is distributing that traffic, or we can say it is forwarding the traffic based on the host, as well as it is distributing equally to the instances for the same website. One thing you have to keep in mind that with classic load balancer, you can distribute the traffic only for one website or one application. But suppose if you have multiple application, like in this example, which is not possible with classic load balancer. If you have two application, you need to classic load balancer. A single application load balancer is enough to handle the traffic of multiple application load balancer. So that is one of the good feature of ALB. Let's understand part this routing. So here you can see a hover website, abc.com. Also, you can see a half abc.com slash blog. The same website you can see. Only the difference is there is one blob on the same website. But first two instances I have used for ABC.com, and last two instances I have specifically used for this blob. And at the application load balancer, I want that the traffic should be distributed using the path. It means that the request is coming for ABC.com. Your application load balancer should forward the request to these two instances. But if the request is coming for ABC.com slash es block, it is going to distribute, it is going to forward the request to these instances. So that is called your path based routing. So that's all we will see in the next lecture. 6. Network Load Balancer (NLB) Overview: The next type of elastic load balancer is network load balancer, NLP. This load balancer operates at the network layer of the OSI model, that is layer for it forward TCP traffic to your instances and support for static and elastic IP. If we'll talk about application load balancer that is specifically designed for web application with HTTP and HTTPS traffic. But your network load balancer, which forward your traffic based on your TCP. So that's the basic difference between your application load balancer in network load balancer. So let's take an example to explain you. Suppose your company's website is running on for M4 XLR instances. So these instances having enough resources. And you are using an application load balancer to distribute the traffic among them. Suppose your company has launched a new product today and which has got viral and your website starts getting millions of requests per seconds. In that case, what will happen? Maybe your application load balancer is not able to handle the sudden hike in traffic. So this is where the and that'll be a really science. It has the capability to handle a sudden hike in the traffic. Since it works at the connection level. Or we can say it is, it works on the network layer. So it handles millions of requests per seconds. So that's the idea about an LB. So that's all. 7. Lab - Configure CLB: In this live session, I'm going to show you how to configure the classic load balancer. So first to understand the scenario of this lab, I have to server web server 0-1 and web server 0-2. And before too that we have the elastic load balancer. So the traffic is first coming to your load balancer, and then it is going to distribute on the servers equally. So let me quickly login into my AWS management console. So here you can see I have two web server, web server 01. And this is the public IP. If I'll copy and put it in the browser, you can see it is showing a simple web pages. That is, this is a, this is my first web server and the second web server. This is the public IP. And it is opening another page. That is, this is my second web server. But in actual or idle condition, both the servers should be in sync. Whatever we have on server one, the same should be reflecting on server 2s1. But for testing purpose, I just want to show you how the traffic is distributing both the servers. That's why I have taken different webpage on the servers. Now quickly I'm moving and we'll show you how to create the load balancer. So in the left navigation pane, you can see the option is load balancing. Inside this option we have the load balancer. Click on Create load balancer. We have three options. Application load balancer, network load balancer in classic load balancing, I'm going to click on Classic load balancer. It is going to ask the name, I'm giving any name my first CLV and create Albi inside. If you have the RBC, you can choose your VPC. Otherwise you can go with the default VPC and the desorption that is created an internal load balancer. This is basically for private network. And if I click on this enabled advanced PPC configuration, you can see some more features are coming. So here you can see it is started showing you the level subnets, say File choose all the subnets for this elastic load balancer. So it means that whenever you are going to add the EC2 instances for this elastic load balancer. It is going to take the instances from the subnets. So here you can see at the last, we have to add the EC2 instances as well. So if I choose all three instances, all three of liberty June. So you can take the instances from d's are Liberty Jones. So I'm wing with a default one. And the next is listener configuration. So the traffic is not directly coming to your instances. Rather first. It is going to hit to your classic load balancer. So on which port the traffic is going to hit. So that is defined by your listener configuration. So I'm going with this as TTP, it D port, and this is the protocol and that this is the instance port assigned security group. So I'm going with this, my web SG. So in this security group, I have enabled the port number 80 health checks. So that's very important. So configured health checks, your load balancer will automatically perform health checks on your EC2 instances and only doubt the traffic to instances that passed the health check. So this is the criteria to check the health check. So ping protocol is HTTP. It is going to hit two port number 80 and which part it is going to hit the spot. And also how come your elastic load balancer will come to know that particular instance is healthy or unhealthy. So here we have defined few parameters. The first one is response, time out. Time to wait when receiving a response from the health check. So it will wait for five seconds. And if the instance is responding within five seconds, that's okay. Otherwise, it will come, the instance is not responding, right? So this is a timeout. And in every 30 seconds, it is going to check the instances. You can change the time as per your requirement. Now, unhealthy. Suppose I have two instances. Website was 01 and webserver 02. Web servers 0-1 is having some hardware issue. It is not a responding. So what will happen here? First, it is going to check the silver in 30 seconds. If the silver is not responding. Again. After 30-second, it is going to ping the server consecutively twice time. If the server is not responding, it will declare that instance as an unhealthy. Because I have mentioned too, if I put four, so four times the integral of thirty-seconds, it is checking the soul as if it is responding liners, okay? Otherwise, it will declare the instance is unhealthy. Suppose your elastic load balancer has declared one instance is unhealthy. And after some time, the server has come up and it started responding. So after how many threshold time, your toxic load balancer very declare that unhealthy instance as a healthy one. So that will define by this. So if I'll put five times, so it is going to check the silver for five intervals. First-time it is going to hit, the server is responding. It is not going to declare that instances a haldane. It will test for five times the interval of thirty-seconds. In all the five consecutive interval, if the server is responding, then your classic load balancer declared that instance as a healthy one. Okay, after that, add the instances. So I'm going to put both the instances here. We have two more option that is enabled, cost Joan, load balancing. So it is going to distribute traffic evenly across all targets in the liberty Jones enabled followed load balancer. We have one more option that is enabled connection training so the number of seconds to allow existing topic to continue flowing. So you can teach the second expo requirement. Text. I'm going to put name, review AND gate. My classic load balancer has, has been created successfully. Now here you can see all the options are coming description instances. So here you can see as of now both instances status is out of service. It will take some time by the load balancer to identify both instances as hell, the one health checks, you can see this is the health check we have defined. At any time. If you want to change the parameter, you can add it. Listener, the listener setting, monitoring. It is started monitoring. Here we have the CloudWatch metrics, texts, and migration. So let me again check and I can see both of my instances in service. You can see the status or late it was out in service, mode is in service. And if I go to description here you can see I have the DNS name of your elastic load balancer. This, I have got the DNS name. So let me copy this one. So if you have configured the Route 53 in your environment, so you can give any public IP to this Nim. And then you can use the LEOs and give any name which is suitable to you. So I have just copied that DNS name of my elastic load balancer and put it in browser. And I can see this is my second web server. Let me refresh it. I can see that one time it is going to my server, and second time it is going to second server. Let me keep on refreshing. And I can see that elastic load balancer is working perfectly. It is distributing the traffic as well. So that's all we'll see in the next lecture. 8. Troubleshooting - CLB: Hello everyone. So in the previous lecture, I'll show you how to create the classic load balancer. And at the backend, you are having two instances. So what I'm going to do, I'm going to stop my web server to write. So before stopping, let me show you. So let me refresh it so fast it is going to my first sour and it is going to second silver. Now harm selected action instances tape and I'm going to stop my distance away. So I will show you how, you know, it is checking the health checks. Again, I'm going back to my this one. This is my load balancer and this is let me refresh it. It will take some time because I told you the parameters that you have mentioned, it will check accordingly. So as of now, you can see that it is, it has not declared my instance as an unhealthy. All right, so, so these are my instance and I can see that my one instance is out of service, right? It has removed that instance from the elastic load balancer. That is my classic noggin coming back here. If I'm going to refresh this one, you can see that this one, this is the IP of my elastic load balancer. So which instances down it is down my web server to. So it should not go into the web server to let me keep refreshing, Mackenzie, That I'm refreshing it. But it is not going into my web server too, because at the load balancer, it has the information that the second instance, that is web server two is unhealthy, which is out of service from the load balancer. Now if any traffic which is coming to my load balancer, it will forward that traffic to web server one on Lee. That's 05:00 AM refreshing it. You can see that I am able to access my first web server. All the traffic is going to that friend. That's all for this lecture. In the next lecture I'm going to show you how to configure the application load balancer. 9. Load Balancer Stickiness: In this lecture, I'm going to discuss about load balancer is ticking as in the exam also, you may have a question from this topic. So let's understand. It is possible to implement a stickiness so that the client is always City directed to the same instance behind a load balancer. So let's understand the concept of stickiness from this diagram. So here you can see I have a load balancer and behind that we have two instances. So by default, stickiness is disabled. So it means that whatever the traffic is coming to this load balancer, it is going to distribute equally to both the servers. This is the default behavior. But if I'm going to enable the stickiness on this load balancer, what will happen? It is going to redirect the request to the same instance again and again. In the exam you will have the cushion like suppose you have three instances behind your load balancer. One instance who's CPU lesion is showing 80%. And other instances utilization is showing normal, that is between 40 to 50%. So what could be the reason for that? So the reason is stickiness. We'll at your elastic load balancer. So let me quickly login into my AWS management console and we'll show you how we can enable this stickiness. So go to this target groups. Here we have this internal TG that is a targeted group. Target group on come to this attributes added. And here we have the option to enable the stickiness. That type of a stickiness associated with this target group. If unable, the load balancer binds a client session to a specific instance within that target group. So here you can define the stickiness duration. You can define in days, hours, minutes, and seconds. So if I go here and if I refresh it, you can see that my request is going equally to both the servers. But if I'm going to enable this one, and if I refresh it, if it, if it has got one session from one server, it will stick on that server till the stickiness duration time will be over. So that's all we'll see in the next lecture. 10. Monitoring of Load Balancer: In this lecture, I am going to discuss about monitoring of load balancer. In the previous lecture, I had created one classic load balancer. I'll have selected that one. And you can see different tabs. We have like description instances. You have to click on monitoring tab. Inside that tab, you'll start seeing a number of metrics. These are the CloudWatch metrics. All load balancer metrics are directly pushed to CloudWatch metrics. So the mountains we have like unhealthy host, healthy host, average latency request. And also you can see metrics like HTTP, five, XXS, ELP 5X Access, back-end connection errors, search, queue length on different metrics are there. Now the question is, how would they understand what is the meaning of these metrics? So to understand this, you need to click on this link. And this link is basically for CloudWatch metrics for your classic load balancer and just as called on. And here we have the details about all the matrix. If I'll talk about this matrix, backend connection errors, let me show you where we have. This is the metrics for backend connection air. As of now, I do not see anything in this metrics. So let's understand what is this matrix. So this matrix is that the number of connection that we're not successfully established between the load balancer and the register instances. Because a load balancer retries the connection when there are errors, discount can exceed the request rate and the reporting criteria. There is a non-zero value. You start seeing some non-zero value. It means there is some backend connection error like this where you can read the description of any metrics. Let me call on. And it will start showing you all the metrics like hell, the host count. And this is the as TTP quote underscore backend, underscore two x x. And this is the STDP quote underscore ALB, underscore 4X x the number of this client error codes generated by the load balancer. So this matrix error is showing you have some error related with the client error codes. Reporting is there is a non-zero value. And this code is for the number of this core server core. So this is for the server error codes. So you need to read the matrix to get more details coming back here. And if you want to see these, you know, matrix from the CloudWatch. So you need to click on view all the CloudWatch metrics. So here we have this elastic load balancer. You can also view the automatic dashboard as well. And I can see that it is starts showing you the metrics here as well. So from CloudWatch also you can see all these matrix. So this is one thing. If I'll go to this target groups. In target groups also we have the option for monitoring heavy have monitoring. That is showing this, have the host, unhealthy host. Okay? So this way you can do the monitoring of your load balancer. So that's all we'll see in the next lecture. 11. Access logs of Load Balancer: In this lecture, I'm going to tell you about load balancer x's logs. X is logs from the load balancer can be stored in S3. So by default, x is lock is disabled for a load balancer. But once you enable it, it will start capturing whatever the activity is happening on your load balancer into S3 bucket. So let me show you how we can enable it. So this is my load balancer. In the description tab. Let me show you go to this attributes. And here we have the option four x's logs. You can see it is disabled by default. Configure access logs and enable it. And here you need to define the interval by default is showing five minutes. You can change it as per the requirement. And here you have to give the location of your S3 bucket. If you're S3 bucket is already created, just give the name hair. Effort is not catered. You want to create a new one that is also possible. Let me show you security logs, TLB. So I've just given this Nim and I want to get this location for me. Save. So it will create one bucket as well. I can see that there is no back-end Lechner refresh it. And I can see that one bucket has been created. So anything is happening to my this load balancer, all the logs will start storing into this S3 bucket. So let me copy that DNS name of this load balancer. Okay, if I'll go inside. Ok, it is AWS locks. So after, you know, five to ten minutes, it will start capturing the logs. And inside this location here, after this AW is log, it is going to create one directory and the name of the directory would be or something ELP, something inside that you will see that it will start capturing the fines. So for, and that's all for this lecture. 12. Lab - Configure ALB: In this lecture, I will show you how to configure the application load balancer. So in the previous lecture, we understood about the classic load balancer. So I have already deleted my classic load balancer as of now, I have two instances. So to configure the classic load balancer here you can see an option for the target groups. First you need to clear the target group I have click on target groups. There is an option to create a target groups. So your load balancer routes requests to the target in the target groups using the target's group settings, and then specify and perform the health checks. So far, application load balancer, you have to first create the target group. So my target application load balancer, you can give any name. Now, target type it has given three options. Instance. So for my case I have the instances, so I'm going with the instances. Ip means suppose there are few solvers, which is, you know, apart from your cloud, that is the AWS cloud, but those services having public IP. So here you can mention the public IP. So maybe the source is not the part of your AWS. In that case, you can go with the IP. And the third one is lambda function. So I'm going with this one instance. Protocol is a CT-PET, a t, and this is my Vbc, This is a default VPC. And here the protocol and the part is my index dot HTML, right? And healthcare, that is the same that we discuss here. So traffic board giving threshold, that would be two, right? So the number of consecutive health checks successful required before considering an unhealthy. So this one that this is what the unhealthy timeout and this one interval. I am going with a kid. Now. My elastic load balancer has been created now. Now here you can see the options are coming. The health checks monitor everything. What do you have mentioned? Well, configuring it, it is showing their mind the targets. Here. You can see that I can add it and add my instances. So let me add my instances. Okay? It is showing only one instance because one instance in the previous lecture, I stop that instance. So let me start the instance. Okay? So by the time my extensive starting, I'm, I'm just going back to this one, load balancing and target schools I have already catered by, but I have not added the instances into my target groups and click on this load balancer. The load balancer might this time I'm going to choose this one application load balancer. I need to give the I name this as my application load balancer. Internet facing internal and going with the internet facing IP address. Okay? And this is my listener. A listener is a process that checks for the connection request using the protocols and the port. This is my, this one. If you have any other port, you can go with that. Or if you have any other listener port you can add on. Alright. And I will able to dunes you have three habitability Jones For this reason, I am choosing all of them. So instances could be from that part. So after that configure security groups, it is giving a warning because I haven't use HTTPS. No issues. Configure cigarette ego. I'm going with this one. This is my web server. Now, this is for the routing. So if you have already created, how already corrected this one that is my target LB, Right? So this is my instances protocol, this one, and this is the path it will be looking for right here also, you can see that it is providing the health check off your instances. So I'm going with the default one and register targets, review and grade. So all done now, my application load balance that has been created on, let me click here my load balancer. So this is my application load balancer. It is in provisioning. It is a state. So I need to wait for a few more seconds. Health checks, targets at deserve my okay, at two register. Now, this one I edit and save. None of these have liberty contains a healthy targets, so I need to wait for. Sometimes the target logistician isn't process. And this is my load balancer, right? Is still improve his name. So when you, when you need to configure application load balancer, first of all, you need to clip the target groups on what's the target group will be catered. You need to click on this targets and after that, just at the instances that is working at the backend. So I have two instances. This is my web servers and web servers Z22. After that, just click on in a load balancer and this current, this one. Let me take this one. So it isn't provisioning. It will take some more time. Let me copy. And once it will be done, you can see that it will provide you the DNS name as well. So here in the listener, this is showing here, I will show you, let me give some, give me some more time. So this is my first server, and this is my second server. So my application load balancer is started walking now. Now here you can see that I'm getting an option, right? So this is my application load balancer. I have selected this one. Click on Listener and just view and edit rules. So here you can see that I have lot of other options as well. Right? Now I can click on the plus button and after that, you know, insert rule if you wouldn't do in central, Like if you remember when we were discussing about the path based routing and this host based shouting in the past based routing, you can click this one and add cuny connection. You can insert any rule here, right? So a lot of options are coming here. Like this one at condition if you want to add any path. So you can add the path as well, the value. So you can make your application load balancer more effective with these rules. So that's all for this lecture. 13. Lab - Configure Path Based Routing (ALB): Hello everyone. This is Aleppo assertion and which I am going to show you about part based routing. It is one of the advanced feature of application load balancer. So here you can see that I have configured application load balancer and at the back-end have to so on. This is my web server on which I am having the mean website. I do have another server that is my web server to On which are have the blob. So the website is same, that example.com or whatever. And one server I'm using for my main website, another I'm using for the block. So if any hit any traffic is coming to my, you know, application load balancer. If it is coming four main website, it will route that traffic to here. And if it is coming to this block, it is coming for the block. It will route that profit to the web server too. So let's understand about this application of load balancer. This is, we can say this is an advanced feature of application load balancer, which is not available with classic load balancer. So after instances, this is my server one. And if I'm Copy this, and if I'm putting here, you will see that I am getting this one. But here in my sour to I'm going to make it as a box our right. So as off my 5m copy and paste, it is showing me this is my second summer, but I do not want it should be it should walk as a, you know, blocks over. So let me login to my this this is my second server, I believe. So. I'm adhere location that is 207 is my type is this 1207, right? So this is my second sort of, okay, I'm here now. So I'm going to create a, let me copy this index mechanism block, right? And VIA block. And I'm going to change this one. This is my block. This is my block server. I've, so I've saved this one and I am removing this index.html, right? And this is some CTO, a restart my asset TPP. So that's done now, if I'm coming here and if I am putting this block, it is opening this one. I'll simplify this one. It is not going to happen because it is taken from the cache. That's why I'm getting this. Now you can see that it has, I'm not getting this one right. So once I have the main server, this one, right? And my second web server, it is a block server. Now, after service, I'm going to my this one target groups. Now here I need to create to target groups. The first target group i'm going to thread as my main light is, it is an instance. Everything's fine here. And here I'm putting index dot HTML. And all I'm taking the default one cleared. So my false target group has been created. Here. I need to put added and I need to add the instance. So for my first target, I'm going to put my server is this one. So one edx register. That's done and save, right? I need to create one more target group that is for the block. So I am giving the name of my target is block here, I think is fine. Now I am going to get hit hair. Alright? So there's done like me, I think I need to add this one. This one added health checks. And here I need to put this one block. So I have to, you know, target roofs I've created in blog, I need to add my instance as well. So for block, I have this, this is my second web server. You can see here this is second one. So that's done. So a half credit to y'know, to target groups. Now I'm click on this, advance, this load balancer. I'm going to create the load balancer. I'm going to create this one application load balancer. This is my application load balancer. It's a path-based. I'm putting path, right? It's internet facing, everything's fine. I've liberty. Joan. Click, all my availability. Jones, I want my expenses should be from all the eligibility Jones. So that's done after that. Configures security groups. Okay. Fine. I'm going with this one. Not is asking for the register targets. So I'm using the existing target groups here I'm choosing may normally, right? And this is the main, you know, my target group, which I have already created in that target groups are, have the server of my first web server right now, face to targets a review. And K. So my this ALB part, this is my application load balancer is provisioning here you can see the status and this is my listener monitoring. Okay? And if I click on this target, it is showing unused, right? Because this target groups, this is my block target group that is not currently in used here you can see that main has been this target group is aligned to my application load balancer, but this block is not aligned to any of the load balancer. That's why if I'm click this one, it is in a Xing In progress, but they file click this one in blocked. It is showing that unused because this is not being used, so it is in use. So I need to wait for few milliseconds. Let me click on this, my load balancer, it isn't provisioning and I'm click on listener. So in listener you can see that a 2.55 the options to create the rules as well, right? So let me wait for few milliseconds, right? So click on view and edit rules, right? And there's an option, okay? And insert rule at condition. You have to look for this pop and just define this one, right? Make sure that whatever you are doing that is inside your application load balancer, right? That's done. Okay, and in action, forward to that is my block. This is the instance name or how it is giving all instance. So you need to, to this one. So that's done now. So I have created one rule that is for my blog, that is, path is less block. So what will happen here? That rule I have added now, let me come back here. Now my, this elastic load balancer is active. Now, this is my description. Now, let me copy this one and we'll show you what the signal. Now you can see that if I click here, it is going to my first server only, right? And if I won't do access my this block, I need to put less Block. A file mentions less Bach. It is going to my doc server, noggin. I'm coming back to my this elastic load balancer. Now here, if the request is coming to DNS, the DNS name of my server is going to this one. And in the rule I have mentioned that if somebody is giving a path that is less block after the DNS, it should forward that traffic to this block sour. Here. You can see that I have used a single load balancer. And you can see I have only one DNS name. And from that single DNS name, I can forward my traffic to do different solvers. Alright? So with one load balancer or have no created this, this is not possible within your classic load balancer, right? So I believe you understood what I want to convey you. So here you can see that if all simple firing this one without block, it will be going to my, the first server. And if I mentioning stress block, it will be going to some different server. So this is the advanced features that we have with application load balancer. 14. AWS Auto Scaling Overview: Hello everyone. Let's continue and understand important topic AWS, auto-scaling. Auto-scaling monitors your applications and automatically adjust capacity to maintain a steady, predictable performance at the lowest possible cost. So in traditional IT wall, there are limited number of servers to handle the application load. When the number of request increases, the load on the source also increases, which causes latency and failures. Aws provides Amazon EC2 auto-scaling services. To overcome this failure. Auto-scaling ensures that Amazon EC2 instances are sufficient to running your application. You can create an auto scaling group which contains a collection of EC2 instances. So here we have example. Now you can see that you can define an auto scaling group than minimum size, that desired capacity. And this is your maximum size. And also you can use a scale out as needed. So you have to create the policies as well. So minimum size is basically counts the instances that should run inside the auto-scaling group. This value can be overwritten by desired capacity here. So desired care facility basically the number of EC2 instances that should be running in that group, that desired capacity must be greater than or equal to the minimum size ds1, and also less than or equal to the maximum size, right? And this is your maximum size, the maximum count of the instances that might be created inside the auto scaling group. Suppose this is my elastic load balancer and a half configured a web server, right? And initially, it is configured as a two instances. I have configured the auto-scaling group as well, auto-scaling group and shows that at least there will be two instances running for this web server. So the request is coming to my, you know, this elastic load balancer and it is distributing the traffic. And traffic is coming to my EC2 instances. And auto-scaling is maintaining the number of instances. And use some policies that we'll understand in the lab session. One policy like if any of the United States, suppose this first instance, who's CPU utilization is more than 80% for continously 60 seconds I have defined. So nobody that I will do the left section as well. So what will happen here? If the CPU utilization is more than 80% continously for a specific time, like one-minute, five-minute, whatever. Your auto scaling is going to add one more instance. So ugly and we were having two instances. Who is, you know, handling the load for my web server. Now, auto-scaling, I have configured auto-scaling and fee policies that have configured with that policy. If the CPU ablation is increases to any of the instances more than 80% for a specific period of time, it is going to add a new instance. Suppose after some time, the CPU list1 is again, you know, goes to its normal condition. So superlattice. And again, I have created one more policy that is further decrease instances. And here I have mentioned that if after some time the sheep utilization is less than or equal to 30% and it is continously for, you know, five minutes or one Nair. I wanted should remove the instances, it is terminated the instances. So this is how you are in order scaling walks. Here we have one more example. This is my elastic load balancer. It is distributing the traffic hair, alright? And as you can see that for instances are running and also I've configured like Mifune stances should be running on my availability zone a, unfused tenses should be running on availability zone B. Now, the policy I have used here, it is 40, no latency. So if the latency and the elastic load balancer effort is more than, greater than 500 millisecond. What will happen? It will add up to more instances, right? And if the latency and the elastic load balancer is less than a 100 millisecond, it is going to downloading of the two instances so you can create the policy with respect to CPU memory, disk utilization latency. So when you are going to configure it, all options would be there. So for inter-cell, for this lecture, I hope you got an idea about what is auto-scaling all about. In the next lecture, I am going to do a lab session so that you can easily understand all those concepts. So if you have any confusion, please let me know. Otherwise, please move on to the next lecture. 15. Auto Scaling Group & Configuration - Lab: Hello everyone. So let's start doing the lab session on auto scaling group. So I have already logged into my AWS management console. And very first step here you can see that a half configure one instance. So this is ten is my web server, and this is the public IP. I have just copy and put it in the browser. You can see that what I am getting. So it's a simple website I have configured with one of my instance. And using that instance, a half credit one, AMI. And I've given the name of my MAs or web server. Now I'm coming to auto-scaling. We have two options, that is launch configuration and auto-scaling group. If you're directly click on auto-scaling group, it will ask you to launch configuration fast. So launch configuration is nothing. You have to define like what all the instances that you want to define foil auto-scaling group. So let's start with create launch configuration. Now it is asking you the instances which you want for your auto scaling. So I have already configured my AMI. So I'm using this one and going with the default options. It is asking for the name of your configuration, of your auto-scaling. I'm giving auto-scaling group configuration. But she's option request spot instances if you want, you can go with that. I am role I am not defining as of now, if you have, you can define. So those IAM roles will be defined for your instances, right? And here we have options like KamLAND, so Carmel will help, will keep your instances of today with security fixes and updates. The remedy so you can go through what all the options we have and user data, basically, you can put some scripts here or some command here. So what will happen once you're in no instances will be up and start running. Those, you know, scripts will be run as a post implementation. Ip assigned what IP want to give to your instances. Only. Assign a public IP instances to your launched in that default VPC, right? So I'm going with a default one. I'm not choosing any of the options from the advanced. And next is storage. And here I'm choosing this one. This is my security group. Review. Create this. So it is asking for the key. So I have defined the key. So these cue basically for the instances that you want to configure. So my this one configuration has been integrated. Now create an auto scaling group using the launch configuration. So this is the name of my configuration right? Now what the name you want to give for your auto-scaling, I'm giving my fast auto scaling group, right? And when might this, you know, auto-scaling group will be started. It started with how many instances? Suppose I wanted, Should we started with two, right? So two instances, it will be, you know, using the EMI which I have configured in my this configuration file. So it will pick the EMF from that configuration and we'll create the instances. If you have any VPC, you can configure here and all the subnets I want my in this instances will be created. And all the inner subnets for high availability and your auto-scaling is intelligent enough while creating this tenses, it is going to put the instances into different, different subnet mask or subnet availability zones. We can see that. So here we have emotions like flops, Shane's like load balancing you want if you have. So in this lab session, I'm not going to use at any load balancer. I'm going with a default option. Now this is very important, like the policies which you have to create for you. So use the in-order scaling policy I've clicked and after that, this one is scaled auto-scaling group using stops or simple scaling policy. So I've chosen this one. So first one is this one, increase crop size. So is scaled between two. It means that the minimum is tensors would be two and it will scale up, up to, I'm giving aid. So it will keep on at it the instances as the load increases and it will reach us, increases till it reaches the number eight. Alright, so let me get one policy here at New alarm, an alert and hair. You can create the topic like if you, if you want to get the notification as well, like mail notification that you can configure this one. I'm using this one, maximum CPU utilization. And here we have all the options like CPU. And you want to use our discreet discrete operations described network. All the options we have air. I want my CPU dilation is going more than 80% for at least one consecutive periods of wonder I'm giving. So if the CPU sent off any of my instances, it is more than 80% and continously for 60 seconds. This alone will be created. And did the action what I want for action I want, I can put this one, add one more instances. So this is the policy I've defined hair. So when my auto-scaling will be started, it will start with two instances. And any other instance is having CPU utilization is more than 80%. For 60 seconds, it is going to add one more instances, right? This is for you increase group size. I can also create the decreased group size as well. So again, I'm going to click here. And minimum, I am putting this one if the CPU utilization is less than or equal to, say for example, 30% and for at least one conjugative period of one minute. For testing purposes, I am choosing only one minute. Ok? So what it is going to take the x n, it is going to remove one instances. When your CPU utilization is less than 30% for 60 seconds continously. Next, this one at tag, I can give the tak My first auto scaling group. So what will happen here? This is the name of the instances that is going to be created, right? Or we can say that servers auto-scaling group service review. You can check the configuration that you have configured for your auto scaling group and create auto scaling group. Successfully created an auto scaling group. Let me close it. And let me see about these instances. So let's put the configuration. The 2s tenses should be started. Now you can see that my 1is tensor started right? Centralist start one mode instances. Let's wait for a few more seconds. I will see that two instances, they'll be started. Forget about this one. This is, this was instances which I have used to create the AMI, right? But in the auto-scaling configuration, I have defined that it should start with two instance. Now you can see that two instances are walking. Now, let me remove this one. Right. Now. Like two instances is starting with the auto scaling group, right? So this is what I want to achieve from this lab session. And I will also define few policies like the CPU lie just shut off any of my instance, it is going in more than 80%. For four, I know continously 60 seconds, it is going to add one more instances, right? So my two instances, I started running. Now you can see that let me delete this one 10-minute. Otherwise you will be confused because, you know, to start or to configure the instances for the auto scaling group it is going to use for my AMI, alright? So there is no use, like we terminate this one. Like two instances are running fine now. Okay? And that's all for this lecture. In the next lecture I'm going to do some lab session in the lab shit and I'm going to increase the CPU. And we'll show you how the news tenses are add up to my this auto scaling group. And also, I'm going to again reduce the CPU to less than 30% or 20%. And we'll show you how the instances willing are removed from your auto-scaling group. So that's all for this lecture. If you have any query, any concerns, please let me know. Otherwise, please move on to the next lecture. 16. ASG Policy - Increase Group Size: So let's continue and do the rest part of this lab session. Now you can see that in my auto scaling group, I had defined two instances as a minimum instances or desired instances. We can say that. So that's why two instances has been started with auto scaling group. And there I have selected this one is G one. And this is the public API of my first server, and this is the public IP off my second server, right? So I have copied here and put it in my browser. Both the server is giving the same output right? Now. What I'm gonna do, I'm going to login to one of my instance, this one, for instance. Ok. And I'm going to manually increase the CPU because we had also defined few policies. Right? So if the CPU utilization is more than 80%, let's see, my auto-scaling group is going to add a new instance or not. So this is my first server here. You can see that and I have taken two session to petition for the same server, right? Okay. Now, here I going to fire this one top, come on. And the CPU utilization, you can see that it is a 100% free, no load is on the server as of now. I am going to increase the load. So we have few commands, DD, This one. So far, this command, it is going to increase the load on the system. So same, Come on, fire many times. So it is running in the background. So this sample is to run any commodity that background. And I can see that CPU, a lot of these commands has been started now, the DD commands are fire. And you can see that the idle, it means that how many CPU is freed is 0%. It means that my CPU utilization has been raised to a 100%. All right, let me find a few more commands here. Now as per the, you know, auto-scaling policy, if the CPU utilization is more than 80% and continously for one minute. So it is going to add one instance. So let's see, it is going to add instance here. So let me wait for few seconds, few minutes. So let me pause this video for one minute. Now you can see that a new stance has been started adding into my auto scaling group, this one, right? It isn't initializing. You state after sometime, you will see that this new instance has been completely added into my auto-scaling group. If I'm copying this one, this is the public IP and let me check it in the browser. I can see that the same output I am getting from this browser as well. So if you'll remember in the previous lecture, when you're configuring the configuration of the auto scaling, we had defined the AMI. So basically it has created a new instance using that AMI on Lee. All right, now I'm coming back here and let me log in here. And the services EC2 here. You can check all the configurations of your auto-scaling group here. Let me click here. So all options are coming like and see that as of now three instances, a limb, it was two instances, right? And minimum is two. And it will maximum goes to eight instances. And it's killing policies. So there are two escaping policies, decrease size and increase size. So friends, that's all for this lecture. In the next lecture, I am going to reduce the CPU utilization and we'll see that my auto-scaling group is going to remove one instance from my this EC2 instance. So that's all for this lecture we will see in the next lecture, bye bye. 17. ASG Policy - Decrease Group Size: Hello everyone. So let's continue and do some more practice on auto scaling group. So now you can see that we have three instances. One instances has been added as per my auto scaling group policy. Now what I'm going to do, I'm going to reduce the CPU utilization. So I can see that it is completely occupied. A 100% utilization is going on. And these are the culprit process or dd command which had fired. So let me take one more session here. I've already taken and I have, you know, copied all of these. This is the process ID of my commands, right? I'm going to kill all those. So if I'm going to kill all those, what'll happen here? The CPA license really start reducing. So two more processes are still there. This one like let me kill those two as one, 5-6 eight n 1569. Now I've kill all the processes of DD right? Now, idle is 99%. It means that CB relation is again in a reduce to 0%, right? I'll leave it to us. It has been increased to 100% because of the DD commands which I had fire. Now as per the policy, this one that decrease group policy, it is saying that if you're CB utilization is less than or equal to 30% for continously 60, 60% seconds, it is going to remove one instance. So let's see. I'm coming back here. I need to wait for a few seconds, few minutes. Let me pause this video. Now you can see that one of my instance is sundowning. It means that it is terminating from my auto scaling group. And I'm coming back here. And let me refresh this one. And I can see that it's denser layer was three. Now it has come to two because one instance is terminating now. So this is all about your auto scaling. You have to understand what is auto-scaling all about and how we can create the policies. So for herself, for this lecture, will see you in the next lecture. Bye bye. 18. Last Lecture: Congratulations, you have reached to the last lecture of this course module. I believe you have learned something from this course, is still if you have any doubts, concerns, suggestions, query. You can put into the cushion Ansar forum of this course module. Or you can directly pink to me as well. I will try to respond as soon as possible. So all the best, good luck for your exam and for your carrier SQL. Bye-bye.