Application Load Balancers | How to create an internet facing load balancer in AWS?

Поделиться
HTML-код
  • Опубликовано: 29 июн 2021
  • This video explains how to setup an Application load balancer in AWS and load balance the data between servers behind private subnets.
    start-up script:
    #!/bin/bash
    yum install httpd -y
    systemctl enable httpd
    echo "This is instance1" (greater than symbol) /var/www/html/index.html
    systemctl start httpd
  • НаукаНаука

Комментарии • 78

  • @mathisart
    @mathisart 2 года назад +4

    The explanation is such high quality and no-nonsense. This channel deserves more views.

  • @jacqueskoorts9968
    @jacqueskoorts9968 2 года назад +6

    I'm going to try this out now. What I like about this video is that its recent with the latest AWS console. Also it uses the ALB where other videos use the CLB. And lastly it explains why a public subnet is used in this video if mostly what this video is about is the private subnet. Well done!

  • @Vmr48765
    @Vmr48765 Год назад +2

    Hi there, I followed your video step by step and got both EC2 instances as failed helth checks. Here is what I did, I used the new console to setup a VPC of 2 public and 2 private subnets. The security group on the private subnets are:
    Inbound:
    1. ssh port 22 inbound from my IP
    2. TCP 80 inbound from ALB security group
    Outbound
    1. Allow alltraffic outbound 0.0.0.0/0
    ALB security group
    Inbound
    1. inbound allow all traffic 0..0.0.0/0
    outbound:
    1. outbound all all traffic 0.0.0.0/0
    2. outbound TCP 80 to webserver 1 security group
    3. outbound TCP 80 to webserver 2 security group
    Health check status is as follows
    Protocol HTTP
    Port 80
    Path /
    Healthy Threshold: 5 consecutive health check successes
    Unhealthy Threshold 2 consecutive health check fails
    Timeout 5 seconds
    Interval 30 seconds
    success code :200
    The NAT gateway is in public subnet 1
    IGW is associated with the VPC
    The route table associated with private subnet 1 has the following entries
    1. 10.0.0.0/16 local
    2. 0.0.0.0/0 Nat-gateway
    The route table associated with private subnet 2 has the following entries
    1. 10.0.0.0/16 local
    2. 0.0.0.0/0 Nat gateway
    The route table associated with the public subnet 1 has the following entries
    1. 10.0.0.0/16 local
    2. 0.0.0.0/0 internet gateway
    The route table associated with the public subnet 2 has the following entries
    1. 10.0.0.0/16
    2. 0.0.0.0/0 internet gateway
    ALB is associated with the two public subnets
    ALB;s target group is the intsaces in the private subnet
    I get both instances as unhealthy. Please could you help me? Thanks Happy to even share my WS account credentials for you to jump in and have a look.

    • @listentolearn2363
      @listentolearn2363  Год назад +1

      Hi Vinay,
      Apologies for the delayed response, I dint notice your comment earlier..
      You seem to have done everything correctly.
      The only thing am doubting is the startup script in the EC2 instance. If you had copied the contents in the description, please ensure that you did replace '(greater than symbol)' with the actual symbol. RUclips wouldn't allow be to use '>' symbol in the description (i think it might mess up their html tags).
      Let me know if that makes it work.
      You could even try looking at the ec2 instance logs, that could give more information on the startup script execution.

    • @Vmr48765
      @Vmr48765 Год назад +1

      @@listentolearn2363 spot on troubleshooting this 2 weeks ago I realised there was something wrong with the script upon fixing this it worked. You earned a new subscriber :) can you also make video of deploying in cloudformation and terraform instead of manually it will help greatly :)

    • @listentolearn2363
      @listentolearn2363  Год назад

      great, thanks for letting me know.. :) sure..

  • @rolandoperez7688
    @rolandoperez7688 Год назад +2

    Excellent tutorial; you clearly explained the NAT and IGW components, as well as how to configure all routes 👍, Thank you; this tutorial has been greatly useful to me.

  • @MaHa63b
    @MaHa63b Год назад +1

    Excellent and especially clear tutorial. A lot of thanks for instructor. This tutorial was very useful for me.

  • @valo9883
    @valo9883 Год назад +2

    This is the best video I’ve come across that does an excellent job explaining this topic. You’re amazing

    • @listentolearn2363
      @listentolearn2363  Год назад

      Wow, thank you! :)

    • @valo9883
      @valo9883 Год назад +1

      Your video was very thorough in explaining this. I have a question for you, 1-Would this have worked without the NATG?
      2-Would this be possible with using an Gateway Endpoint instead of the NATG? and lastly
      3-What if I decided not to use either the NATG or Gateway Endpoint, would it have still worked?
      I appreciate your insight and I just subscribed and turned on notifications for all your posts. Please do be encouraged and continue to deliver amazing videos with clear and detailed descriptions.

    • @listentolearn2363
      @listentolearn2363  Год назад +1

      Thanks again! :) and here are my thoughts on your questions -
      1. No, because the instances are in private subnets and it needs internet connectivity to install the start up script.
      2. No, because the gateway endpoint allows connectivity only to s3 and dynamodb from a vpc but not to internet.
      3. The problem would have been with the start up script. However, this is just a demo and in real world, if you are not actually initiating any internet connection and you are communicating only through the LB (which will be the case most the times) then you wouldn't need either of them. Also, if you want to avoid the start up script, you could use a pre built image with the required softwares installed to provision the instance.
      Let me know if you have any follow up questions :)

    • @valo9883
      @valo9883 Год назад

      @@listentolearn2363 Thank you so much. this makes perfect sense. Thank you. Looking forward to more videos.

  • @mohitwasnik9356
    @mohitwasnik9356 2 года назад +1

    You just saved my motivation from assassination by frustration !!! 🐱‍👤 It was beautifully explained, cleared my doubts :)

  • @laurentsantiago3087
    @laurentsantiago3087 8 месяцев назад +1

    Thank you very much for this excellent tutorial! It helped me a lot 👍

  • @juliuscaeser9834
    @juliuscaeser9834 2 года назад

    wow! entire AWS ALB demystified in 15mins such that even my 12 yo can understand. Thank
    you so much for explaining this in a simple and easy approach.

    • @listentolearn2363
      @listentolearn2363  2 года назад

      Thank you so much for your support! Glad it was helpful! :)

  • @chandansharma9758
    @chandansharma9758 Год назад +1

    Really Very Nice explained 😊

  • @stephenadams5334
    @stephenadams5334 Год назад +1

    Well Done LTL!

  • @tamilpattucassette6859
    @tamilpattucassette6859 2 года назад

    Thanks for sharing this video. The concept has been covered but not with clear information's. say example - EC2 instance has created without adding tag , NAT gateway has not used too but it's created in this video.

    • @listentolearn2363
      @listentolearn2363  2 года назад +1

      you're welcome.. NAT gateway is indeed used to establish network connectivity from private subnets.

  • @malicksylla886
    @malicksylla886 Год назад +1

    Great presentation :)! Subscribed ;)

  • @Mersal-tq9lm
    @Mersal-tq9lm 2 года назад

    Excellent video 👍

  • @christopherh2579
    @christopherh2579 2 года назад +1

    👋 Covered topic nicely

  • @etza
    @etza Год назад +1

    Yeah, is amazing tutorial, thank you very much!

  • @TomKatsiroubas
    @TomKatsiroubas 2 года назад

    Excellent work.

  • @vsr1727
    @vsr1727 2 года назад

    Simple n good 👌👍

  • @NguyenTung-bz3yr
    @NguyenTung-bz3yr 2 года назад

    Thank you so much!

  • @DeiseZen
    @DeiseZen 2 года назад +1

    Thank you ;)

  • @malicksylla886
    @malicksylla886 Год назад

    Have a question! Since we're not using the public subnet except for the ALB (and of course NAT Gw for EC2 in Private Subnets to get access to Internet...), I am wondering the need of the Internet GW? For me the IGW would be usefull if we need internet access for EC2 in public Sub... but in this case there is no EC2 in pub sub

    • @listentolearn2363
      @listentolearn2363  Год назад

      Good question!
      NAT gw is still dependent on the IGW for internet access (reference: aws.amazon.com/premiumsupport/knowledge-center/nat-gateway-vpc-private-subnet/)
      AWS has removed IGW dependency on NAT only for private communications (reference: aws.amazon.com/about-aws/whats-new/2021/06/aws-removes-nat-gateways-dependence-on-internet-gateway-for-private-communications/)
      More about NAT gw here, if you are interested (ruclips.net/video/NLgiUuGEHlY/видео.html).

  • @terrences6776
    @terrences6776 Год назад +1

    This was a great explanation! So what could be the issue if the target group is reporting unhealthy instances. Thanx.

    • @listentolearn2363
      @listentolearn2363  Год назад +3

      Could you please check the below settings -
      1. The security group associated with the servers allows port 80 access from LB security group
      2. The security group associated with the LB allows port 80 access from 0.0.0.0
      3. The NAT gateway and Internet gateways are attached to the private and public subnets respectively
      4. The health checks are configured correctly with appropriate settings as shown

    • @terrences6776
      @terrences6776 Год назад +1

      @@listentolearn2363 Thank you for your feedback. I actually figured it out. I hadn't launched my instances separately. Once I did that everything started to report healthy.

  • @user-nm2ue3pq7w
    @user-nm2ue3pq7w 10 месяцев назад +1

    Great! I have a question, what if you created those four subnets within four different availability zones ? will it work?

    • @listentolearn2363
      @listentolearn2363  10 месяцев назад

      sure, you can extend this to 4 azs and 4 subnets.

    • @user-nm2ue3pq7w
      @user-nm2ue3pq7w 10 месяцев назад

      @@listentolearn2363yes, it may involve cross-AZ traffic. Cross-AZ traffic can incur additional data transfer costs compared to instances within the same AZ If I am not wrong

  • @ivannadanielacevallos2371
    @ivannadanielacevallos2371 Год назад

    I am trying to access with putty to the instance to modify the HTML but it is not working, can you please help me I am working in the same IP address I specify in the Security Group.

    • @listentolearn2363
      @listentolearn2363  Год назад

      Hi Ivanna,
      Since the instances are in private subnet, you have to use a bastion host to ssh into the instance. Please refer ruclips.net/video/jndBMIJ9gOI/видео.html to know how to setup a bastion host.
      Thanks.

  • @user-xy6wb3jx7y
    @user-xy6wb3jx7y 8 месяцев назад +1

    how to connect nat to private network

    • @listentolearn2363
      @listentolearn2363  8 месяцев назад

      Please refer to ruclips.net/video/NLgiUuGEHlY/видео.html. This explains about NAT gateways and how to create one.

  • @pranav2019
    @pranav2019 2 года назад

    Why you not used nacl here?
    Videos are good

    • @listentolearn2363
      @listentolearn2363  2 года назад

      thanks! sure, can use nacl. it's is an additional layer of network security. It's there by default and it allows all traffic by default.. We can adjust that as per our needs. However, here am just sticking to security groups.

  • @cajetanrahul5747
    @cajetanrahul5747 10 месяцев назад +1

    haha that enough talking was cute

  • @David-jf4ee
    @David-jf4ee Год назад

    You enabled load balancer in public subnet and registered target group in private subnets. Can you please explain this part

    • @David-jf4ee
      @David-jf4ee Год назад

      Please correct me if I am wrong.... Ignore my above comment. So basically where we have enabled our load balancer in an AZ, our target group instances should also remain in that particular AZ. Is it a correct understanding?

    • @listentolearn2363
      @listentolearn2363  Год назад +1

      yes, that's correct!

  • @jashwaaradhya2989
    @jashwaaradhya2989 2 года назад

    Hi, i am running a simple php server on the ec2, not matter what i do, the load balancer health check always says unhealthy. I have the same setup as yours, but i am just running a index.php using apache2. Please help

    • @listentolearn2363
      @listentolearn2363  2 года назад

      Could you please check the below settings -
      1. The security group associated with the servers allows port 80 access from LB security group
      2. The security group associated with the LB allows port 80 access from 0.0.0.0
      3. The NAT gateway and Internet gateways are attached to the private and public subnets respectively
      4. The health checks are configured correctly with appropriate settings as shown

  • @truthofthedecade
    @truthofthedecade Год назад

    Do you teach private online classes??

  • @adinarayanareddy416
    @adinarayanareddy416 2 года назад

    i have configured same way, but it's didn't workout. Servers are being unhealthy if we give public subnet while creating Load Balancer.

    • @listentolearn2363
      @listentolearn2363  2 года назад

      Could you please check the below settings -
      1. The security group associated with the servers allows port 80 access from LB security group
      2. The security group associated with the LB allows port 80 access from 0.0.0.0
      3. The NAT gateway and Internet gateways are attached to the private and public subnets respectively
      4. The health checks are configured correctly with appropriate settings as shown

    • @pranav2019
      @pranav2019 2 года назад

      Yes, facing the same issue
      And can you make a video how to trouble shoot load balancer

    • @pranav2019
      @pranav2019 2 года назад

      In health checks we not defined the path,that may be issue?

    • @AndyCutright
      @AndyCutright 2 года назад

      @@pranav2019 Did y'all figure out the problem?

    • @pranav2019
      @pranav2019 2 года назад +1

      @@AndyCutright here in this video path is not defined
      I also don't know exactly, but I raised the question