Create an Application Load Balancer (ALB) in AWS | AWS Elastic Load Balancing Tutorial for Beginners

  Рет қаралды 37,038

Tiny Technical Tutorials

Tiny Technical Tutorials

Күн бұрын

Load balancing is a key component to any application that’s highly available and scalable. In AWS, an Elastic Load Balancer distributes traffic across multiple instances, and even multiple availability zones if you choose. There are three kinds of load balancers in AWS: Application Load Balancer, Gateway Load Balancer and Network Load Balancer. This video will focus on Application Load Balancers.
In this hands-on tutorial, I’ll walk you through how set up two new Linux EC2 instances that are used as web servers. Then we’ll create an Application Load Balancer and a Target Group to balance traffic between the two instances.
To learn how to incorporate auto-scaling with your load balancer, check out this video: • Create an Auto Scaling...
If you want to learn how to route traffic to multiple target groups, check out this video: • Route Traffic to Multi...
🌟🌟If you’re interested in getting AWS certifications, check out these full courses. They include lots of hands-on demos, quizzes and full practice exams. Use FRIENDS10 for a 10% discount!
- AWS Certified Cloud Practitioner: academy.zerotomastery.io/a/af...
- AWS Certified Solutions Architect Associate: academy.zerotomastery.io/a/af...
00:00 - Overviewing the resources we’ll be building and how they work together
00:40 - Creating two new Linux EC2 instances as web servers
05:07 - Creating an Application Load Balancer in AWS
06:54 - Creating a Target Group for the Load Balancer to route traffic to
08:45 - Testing the Load Balancer
09:26 - Simulating an unhealthy instance to show how Load Balancing behaves

Пікірлер: 110
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
What else do you want to learn in AWS? Let me know below in the comments!
@NarkoChamp
@NarkoChamp 2 жыл бұрын
please do LAB on Site to site VPN
@puneetsaneja3007
@puneetsaneja3007 2 жыл бұрын
ECS, codepipeline
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Added it to my list. Thanks, Puneet!
@MiskoKatua
@MiskoKatua Жыл бұрын
How about AWS WAF?
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Ooh, I like it! I've added it to my list for future videos. Thanks for the suggestion!
@joshuamorillo1694
@joshuamorillo1694 17 күн бұрын
Excellent explanation. Clear, concise, and to the point. Great work! God Bless.
@priyankbisht6229
@priyankbisht6229 10 күн бұрын
thanks for the quick demo.
@zhihenghua2105
@zhihenghua2105 2 жыл бұрын
Thank you so much!!! Finally found an amazing tutorial with traffic routing simulation!
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Thanks so much! Glad it helped! :)
@a.m.1407
@a.m.1407 3 ай бұрын
Thank you so very much. I am glad I came across your channel. Your step by step instruction are perfect. Not too much information and not too less. Most importantly, you don't assume we know some steps that may throw some of us off. Following your instructions is very easy.
@TinyTechnicalTutorials
@TinyTechnicalTutorials 3 ай бұрын
Awwww...this is SUCH a nice comment!! Thanks so much. Really appreciate it! 🙏🌟🤓
@brandonallen-santos7102
@brandonallen-santos7102 2 жыл бұрын
Super simple explanation. Thanks for uploading!
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Thanks for the nice note, Brandon! Glad it was helpful! :)
@user-mw9nq3vk4k
@user-mw9nq3vk4k Жыл бұрын
Great Video and nice to get something working as sometimes you can watch and it doesn't always go to plan.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Awesome! I'm so glad it worked!! Thanks for watching! 😊
@raimsatybaldiev8305
@raimsatybaldiev8305 2 жыл бұрын
You're my favorite teacher in here!!
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Awww, shucks! Thanks for such a nice comment, Raim! Made my day. :)
@bacanalienigena
@bacanalienigena Жыл бұрын
All is working fine, thank you so much "obviously with some slight changes on the AWS interface but all working fine" 👏
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Yay! The UI updates are a never-ending battle. Glad you got it working! :)
@philsitumorang
@philsitumorang Жыл бұрын
This is great! Thank you so much!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
I'm so glad! 😊 Thanks for watching!
@fisherzhu7236
@fisherzhu7236 2 жыл бұрын
This is really good. Thanks!
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Thanks so much, Fisher! :) Really appreciate it!
@samjones4327
@samjones4327 Жыл бұрын
Awesome and Amazing demo! It's always great to see theory in action! Thanks for all that you do for us! You always make things crystal clear for me!! And as always, be well, be safe and Cheers!!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks as always, Sam! Cheers!! 😎
@aleksey6772
@aleksey6772 Жыл бұрын
Thank you so much! Thats so helpful!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
I'm so glad! Thanks for watching! 😊
@GavinKimpson
@GavinKimpson Ай бұрын
these are brilliant! you have another sub :)
@vetonshala4541
@vetonshala4541 2 жыл бұрын
Nice and clear, thank you :)
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Glad you liked it! Thanks for the comment!
@mussa3176
@mussa3176 Жыл бұрын
Well explained, thanks a lot
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Glad it was helpful! Thanks for watching! :)
@arieladalid9910
@arieladalid9910 2 ай бұрын
nice..... well explained, thank you : )
@TinyTechnicalTutorials
@TinyTechnicalTutorials Ай бұрын
You bet! Thanks for watching, and for such a nice comment! 🙏🤓🌟
@Carsino-dev
@Carsino-dev 2 ай бұрын
Thank you so much!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Ай бұрын
You're welcome! Thanks for watching! 🙏🤓🌟
@shouravpaul3092
@shouravpaul3092 Жыл бұрын
This video is great.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks so much, Shourav! :)
@VisualBeatLab
@VisualBeatLab 8 ай бұрын
Hello your the best!
@TinyTechnicalTutorials
@TinyTechnicalTutorials 8 ай бұрын
No, YOU are the best! Thanks for watching!! 🤓🌟🙏
@vipinm655
@vipinm655 2 жыл бұрын
thanks mam,expecting more videos
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
For sure! :)
@chungtran2059
@chungtran2059 Жыл бұрын
Thanks your knowleage
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
You bet! Glad it helped! :)
@srisoundars
@srisoundars Ай бұрын
You the best!!!!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Ай бұрын
Awwww...thanks so much!! 🤓🙏🌟
@nadzhibkuziev8057
@nadzhibkuziev8057 Жыл бұрын
As simple as usual)
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Yay! :)
@DeepAnandrao
@DeepAnandrao Жыл бұрын
Thanks!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Wow, D A - you're officially my first donation!!!! ❤ Thanks SO much! 🙏
@samimirza537
@samimirza537 9 ай бұрын
Thankyou so much for explaining ererythimg in short time
@TinyTechnicalTutorials
@TinyTechnicalTutorials 9 ай бұрын
You bet! Short and sweet. 🥰🙏🌟
@samimirza537
@samimirza537 9 ай бұрын
@@TinyTechnicalTutorials can you also make videos on azure
@TinyTechnicalTutorials
@TinyTechnicalTutorials 9 ай бұрын
I'll probably add some Azure at some point...stay tuned! ☁
@samimirza537
@samimirza537 9 ай бұрын
@@TinyTechnicalTutorials thankyou so much mam as azure 104 is a bit difficult and you explain very well That's why I"m anxiously waiting for you lectures
@MiskoKatua
@MiskoKatua Жыл бұрын
Good tutorial; solved an issue I had. I don't find aws a very user-friendly environment; many different browser tabs to open and configure something else and return back... Not even mentioning their documentation. 😬
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks so much, Jazz! :) This one in particular does require some round-about flows, so I'm glad it helped!
@digitalluxury2033
@digitalluxury2033 Жыл бұрын
روعة شكراا جزيلا لك
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks so much! 😊
@matthewsmithwarren2
@matthewsmithwarren2 10 ай бұрын
This has been helpful. Two noteworthy things to share: 1) In the tutorial an ALB-SG was created and then added to the default. Initially, in an effort to keep things tidy, I deleted the default security group and the demo didn't work. I'm not sure how these two SG's interact but when I left the default in there, everything works. Do you know why this is? 2) My next step is to integrate a SSL certificate for HTTPS to terminate at the ALB. I'm curious to see how this plays out and if I hit any roadblocks.
@TinyTechnicalTutorials
@TinyTechnicalTutorials 10 ай бұрын
Hi Matthew! 👋😊 Hmmm...interesting. You shouldn't be able to delete the default security group? There's really no interaction between default and the one I created. Default is just more permissive, but if you were using the new one, it should have all the right ports open to allow traffic. Here's more info on that: docs.aws.amazon.com/AWSEC2/latest/UserGuide/default-custom-security-groups.html. Let us know how things went with adding an SSL certificate. 💪
@PatrickBurkeTV
@PatrickBurkeTV Жыл бұрын
user data script I used (slightly different from that in the video, but posting this in case it helps others): #!/bin/bash sudo yum update -y sudo yum install -y httpd.x86_64 sudo systemctl start httpd.service sudo systemctl enable httpd.service sudo -s echo “Hello World from $(hostname -f)” > /var/www/html/index.html exit Great video!! Saved me a couple hours.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Awesome--thanks so much, Patrick! :)
@universal4334
@universal4334 Ай бұрын
Does LB maintain instance IP's in Target and will forward them in Roundrobin, right ? If yes, what if a new instance added to that target due to scaling how does it behaves ?
@chetansomkuwar1188
@chetansomkuwar1188 2 жыл бұрын
here you don't have need to create another security group for Application Load Balancer, you can easily attached instance 1's existing Security group to the Application Load balancer with >> SSH + HTTP 80/tcp >> "Source:- Anywhere IPv4".
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Thanks for the comment, Chetan! You are correct! I could have re-used the security group that was created earlier when setting up instances.
@muneebzubair5069
@muneebzubair5069 10 ай бұрын
very good work you are doing, delivering us great value. thanks a lot. what I can do for you?
@TinyTechnicalTutorials
@TinyTechnicalTutorials 10 ай бұрын
Much appreciated! I'm so glad the videos are helpful. 🙏🌟😊 Really the only thing you can do on your side is watch the ads? 😁
@gdevelek
@gdevelek 2 жыл бұрын
Please create a video where the ALB serves multiple TGs.
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
I've added it to my list!
@anthonygonsalvis121
@anthonygonsalvis121 Жыл бұрын
Thank you for the step-by-step explanation. However, when I tried mimicking your steps using an Windows 2022 Base EC2 (instead of a Linux EC2), I could not replicate your output. Will the script you show in the demo also run on a Window's EC2 or are there any other changes needed as well? Also, some the options (not just the cosmetic look and feel) in launching EC2 instances have changed since you published this video... (e.g. selecting an availability zone). Also adding tags or naming security groups was not possible at creation - perhaps not be a big deal since you can do so afterwards. It's a bit frustrating to not be able to debug and make it work. Any advice?
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Hi Tony! Thanks for watching! 😊 You're right...that script is only applicable to Linux instances. For Windows instances, you'll need to set up IIS instead and then create web pages. I found a walk-through here that might help: k21academy.com/amazon-web-services/aws-solutions-architect/create-configure-a-load-balancer-on-ec2-server/. Unfortunately, the UI screenshots are slightly dated as well (a never-ending challenge! 😊), but hopefully it'll get you started as far as how to set up the instances, IIS and the web pages. For the security groups, the important part is to have rules for RDP (port 3389) and HTTP (port 80). Then for the load balancing part, the UI in my video is more up-to-date than what's shown in the walk-through, so that part is hopefully a bit more straightforward. Hope that helps!
@anthonygonsalvis121
@anthonygonsalvis121 Жыл бұрын
@@TinyTechnicalTutorials MANY THANKS for the prompt reply! Just a short while before seeing your response, I retried the steps with Amazon Linux EC2 instances, and was delighted to see them working as described in your videos! Happy camper again! Also realized, of course, that the script was specific to Linux EC2 instances. 😃 Best wishes and please continue posting these great videos!
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Awesome! Glad you were able to figure it out. Cheers! 😊
@puneetsaneja3007
@puneetsaneja3007 2 жыл бұрын
Hi. Is ALB also consider as API gateway where we define certain rules and based in that rules , request will redirect to different target group.
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Hi Puneet - Good question! Yes, you can define different listener rules and then direct traffic to different target groups based on those. Here's some more detail: docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html#application-load-balancer-components
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 жыл бұрын
Hi Puneet! Not sure if you still need this, but just published a video showing how to route to different target groups: kzfaq.info/get/bejne/Zr59ptFyzK68n6M.html. Enjoy! :)
@zj1281
@zj1281 Жыл бұрын
Hey, can I check if i can create a load balancer that takes in HTTPS requests instead?
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Hi zj! 😊 Yes, you can definitely create a load balancer that works with HTTPS. Here's some documentation to get you started: docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html
@sreyamuppalla9219
@sreyamuppalla9219 11 ай бұрын
In the Network Mapping(5:57) part of the video, is there a reason you pick all the different availability zones? Is it because you want users from all those zones to be able to access our ALB? Because also when we created the 2 EC2 instances you selected 2 different availability zones which is confusing me from the network mapping part of the video?
@TinyTechnicalTutorials
@TinyTechnicalTutorials 11 ай бұрын
For this simple application, we don't need multiple AZs selected, but that's usually a best practice so that your application is highly available (i.e., if one AZ goes down, the other can take over). But you're right...I could have just selected one in this case. 😊
@sreyamuppalla9219
@sreyamuppalla9219 11 ай бұрын
@@TinyTechnicalTutorials I'm kind of confused still. What is the purpose of selecting availability zones in the network mapping part of the video?
@tuhairweronnie7385
@tuhairweronnie7385 Жыл бұрын
Tiny do we have a different console?am trying to follow along but am not even seeing where you are getting that window lol
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Hey Tuhairwe! :) I think you must be talking about the part where we create two new EC2 instances? Yeah, they did a pretty major overhaul on that UI. There used to be a way to go back to the older version, but I think that option went away. So sorry...keeping up with UI changes is a never-ending battle! :( All the same configuration options are available on the new UI, but they're just in slightly different places. For updating the security groups, scroll down to "Network settings." In that same area ("Network settings"), you can also update the subnets/availability zones by clicking on the "Edit" button. And then to paste in the "user data"/startup script, you'll need to scroll down to "Advanced details," expand that, then scroll down to the user data section. After you have the two instances created, the rest of the UI (to create the load balancer, etc.) should be the same as what's in the video. Hope that helps get you started!
@duppy9012
@duppy9012 2 ай бұрын
I cannot seem to connect to either of my EC2s Both say "site cant be reached *insert ip* Refused to connect"
@TinyTechnicalTutorials
@TinyTechnicalTutorials 2 ай бұрын
Hmmm...I haven't seen that error before. 🤔 Maybe this will help? stackoverflow.com/questions/36732875/cant-connect-to-public-ip-for-ec2-instance
@lesnoopy7160
@lesnoopy7160 Жыл бұрын
Please how do I get the User Data script?
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Hi Le! Here you go... #!/bin/bash # User data for new EC2 instances # install httpd (Linux 2 version) yum update -y yum install -y httpd systemctl start httpd systemctl enable httpd echo "Hello World! This is $(hostname -f)" > /var/www/html/index.html
@ramirez368
@ramirez368 2 ай бұрын
For demonstration purposes I see you are using just port 80 in the LB as the listener, but in the real world if you have an application you want to put a certificate in the LB and listen on port 443 for the LB no???
@TinyTechnicalTutorials
@TinyTechnicalTutorials Ай бұрын
Yes! You got it. In the real world, you'd likely be using a certificate/TLS and port 443. 👍
@eakokel
@eakokel 8 ай бұрын
Are your ec2s in public subnets? Mine are in private subnets and therefore the 'public ip' or the 'alb dns' dont load anything in browser...how do i achieve this?
@TinyTechnicalTutorials
@TinyTechnicalTutorials 8 ай бұрын
Yes, my instances are in public subnets. If yours are in private subnets, they won't be able to get out to the internet (and other things won't be able to get IN). You could do something like route traffic from the private subnet to a NAT Gateway in a public subnet (this is commonly used so instances can get OUT to the internet to do software updates). But is there a reason you've got them in private subnets? If not, then the easiest approach would be to create new instances in a public subnet...then everything should magically work. 🤓
@eakokel
@eakokel 8 ай бұрын
@@TinyTechnicalTutorialsthanks for your quick reply, it is a company software application and I think they require it in the private subnet, however I may be wrong about that, is there any risks to having an ec2 in public subnet that is hosting software like Weblogic? Will look to see if there is a NAT attached.
@mayankvg9273
@mayankvg9273 Жыл бұрын
Why do we need to add another security group with inbound port 80 when we already have an existing security group that allows traffic on all ports?
@mayankvg9273
@mayankvg9273 Жыл бұрын
I have also observed that it does not work without adding the a new group with inbound port 80.
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Hi Mayank! Good eye. 😊 You could actually use the security group you created earlier...the one I created was duplicative.
@mayankvg9273
@mayankvg9273 Жыл бұрын
@@TinyTechnicalTutorials I tried using the exisiting group without the new group with port 80, and it didn't work. But as I added port 80 later on it worked. Any thoughts as to why this is happening?
@mayankvg9273
@mayankvg9273 Жыл бұрын
Any ideas as to why it does not work?
@omuleanu
@omuleanu Ай бұрын
6:54 you select the newly created sg, but there's also an existing "default sg-088a..." already selected, why is that
@mohammedimran6680
@mohammedimran6680 Жыл бұрын
can i show this as POC in my company?
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Sure, no problem! Thanks for checking! :)
@mohammedimran6680
@mohammedimran6680 Жыл бұрын
@@TinyTechnicalTutorials thank you, i am learning AWS and my company wants me to do some poc
@praveensequeira1525
@praveensequeira1525 9 ай бұрын
1. If we have route 53 pointing to a ELB, does the DNS resolution return a single IP address of the ELB? I think this is the case, but would like to confirm 🙂 2. If we have route 53 pointing to a Cloudfront, does the DNS resolution return a single IP address of the closest edge location? I think this is the case, but would like to confirm 🙂 Thank you!
@TinyTechnicalTutorials
@TinyTechnicalTutorials 8 ай бұрын
Hey Praveen! 👋 1. I've searched through the FAQs (aws.amazon.com/route53/faqs/) and found this: "IP addresses associated with load balancers can change at any time due to scaling up, scaling down, or software updates. Route 53 responds to each request for an Alias record with one or more IP addresses for the load balancer." 2. I can't find a definitive answer for how it works with Cloudfront, but I would imagine it's the same since you don't really know what the IP address is for the edge location and/or that IP address can change. If you find something more concrete, feel free to update here! 😊
@praveensequeira1525
@praveensequeira1525 8 ай бұрын
​@@TinyTechnicalTutorialsthank you. I was just bouncing ideas to clear my knowledge gaps 😊 Agree and as you suggest, the DNS wont return a single ip address especially for those setup with alias resources. Ill tatoo this in my brains.
@TinyTechnicalTutorials
@TinyTechnicalTutorials 8 ай бұрын
😊
@simranbanwait
@simranbanwait Жыл бұрын
font size ants
@TinyTechnicalTutorials
@TinyTechnicalTutorials Жыл бұрын
Thanks for the feedback, Simran! :) I'll remember to increase the font size more in future videos.
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 16 МЛН
🌊Насколько Глубокий Океан ? #shorts
00:42
Неприятная Встреча На Мосту - Полярная звезда #shorts
00:59
Полярная звезда - Kuzey Yıldızı
Рет қаралды 7 МЛН
Универ. 13 лет спустя - ВСЕ СЕРИИ ПОДРЯД
9:07:11
Комедии 2023
Рет қаралды 6 МЛН
Create Your First AWS Lambda Function | AWS Tutorial for Beginners
12:44
Tiny Technical Tutorials
Рет қаралды 127 М.
What is a Load Balancer?
8:22
IBM Technology
Рет қаралды 221 М.
VPC Peering in AWS | Hands-On Tutorial for Beginners in Cloud Computing
13:57
Tiny Technical Tutorials
Рет қаралды 21 М.
AWS Elastic Load Balancing Introduction
12:02
Stephane Maarek
Рет қаралды 127 М.
How I Would Learn AWS Today (after 10 years of cloud experience)
40:28
Be A Better Dev
Рет қаралды 362 М.
SSD с кулером и скоростью 1 ГБ/с
0:47
Rozetked
Рет қаралды 477 М.
APPLE совершила РЕВОЛЮЦИЮ!
0:39
ÉЖИ АКСЁНОВ
Рет қаралды 4,2 МЛН