Posts

Showing posts from February, 2022

AWS Service: Auto Scaling & SNS

Image
  Auto Scaling: – When the load is increasing in Load Balancers autoscaling will automatically increase the instances in Load balancers – Practical steps: create an AMI  use the AMI for the Autoscaling configurations  Add the AMI in Launch configuration  Now create the rule using Auto scaling groups  create an ALB and attach it to the auto-scaling group.  – Launch autoscale: – Create Autoscaling: – Instance created automatically: – Tested with Load Balancer: Target tracking - it will increase or decrease with a single value  step scaling - step by step  simple scaling - overall increase – To check autoscale adding load to CPU: – Sample script to increase CPU load: Inside machine: vi load.sh #!/bin/bash dd if=/dev/zero of=/dev/null bs=50000 count=1000000 vi for.sh #!/bin/bash for i in {1..10} do         sh load.sh done chmod a+x load.sh chmod a+x for.sh – Instance launched automatically: – Automatically attached to Load Balancer: – Mail alert for Autoscaling: To create a notification in

AWS Service: ALB(Application Load Balancer):

Image
  ALB(Application Load Balancer): – Practical steps: Create 6 instances  - 2 instance (main website)  - 2 instance (image)  - 2 instance (video)    Create ALB  Create target groups Add the target group to Listeners  – Comment to run the script(built the website): #!/bin/bash sudo yum -y install httpd sudo echo "This is E-commerce-main server" > /var/www/html/index.html sudo systemctl restart httpd sudo systemctl enable httpd –Script to create sub folder for website: #!/bin/bash sudo yum -y install httpd sudo mkdir /var/www/html/videos sudo echo "This is Video server" > /var/www/html/videos/index.html sudo systemctl restart httpd sudo systemctl enable httpd – Example: – Ec2 creating: – EC2 web Launch: – Main web: – Subfolder: – Adding all instances in Load Balancer (Single website): – Creating LB: – Creating TG: – Adding Subfolder in Target Group: – TG group added in Listener: – LB check: – Creating Hyperlink in Load Balancer for Website

AWS Service: Load Balancer & CloudTrail

Image
  Load Balancer: – Load balancer is used to share the load across instances/docker. – Types: Classic LB - Supports Layer 4(network level tcp/udp)  and Layer 7(app level http/https(web level)) Network LB - only Layer 4(network-level TCP/UDP) Application LB - only Layer 7(app level http/https(web level)) Gateway LB(Networking team) (IP’s)  – Example: – Creating LB: – Status check: – LB test: – CloudTrail: – Captures all the AWS events(like windows event viewer) – Example:

AWS Service- VPN

Image
VPN: Types of VPN: Open VPN  Site to Site Direct connect – Open VPN: – Practical Open VPN:  get open VPN from AWS marketplace  leave the default SG for the VPN OS build   username: openvpnas  Do you wish to log in to the Admin UI as "openvpn"? > Press ENTER for default [yes]: no – EC2 create: – EC2 launch: – OpenVPN console: – DB server launch for VPN check: – Private IP: Elastic IP:    – Give permanent IP for an instances – Before Assigning: – Elastic IP assign: – After assigning: Network Interface:     – Additional network card, works if existing damaged – Before attach: – NIC attach – After attach: Flow log: Like wire shark  - packet capturing tool  vpc - flow log (direct) subnet - flow log (direct) Ec2 - got to ec2 n/w interface - flow log  – Creating log group in cloud watch: – Created flow log:  

AWS Service- Networks

Image
  Networking: Basic Networking:  IP address  2 types :   classful IPS and Classless IPs (ip 4)  Class full IPs:                                      8  8  8  8 class A  (1 - 126)      N H  H  H   10. 254 x 254 x 254 =  1 crore IPs                                   255 0 0 0 class B (128 - 191)    N N H  H    172.16. 254 x 254  = 64000                                   255 255 0 0 class C (192 - 223)    N  N N H   192.168.1. 254 = 254                                    255 255 255 0 192.168.1.1/255.255.225.0 - inside machines  192.168.1.0/24 -  (AWS)  —------------------------------------------- class D (224 - 239)   N N N N (research purpose)  class E  (240 - 254)   N N N N  N - network bit (constant)   H - host bit ( variable)  If you are changing the constant even though it is in the same class, it is considered a different network  132.16.17.1 - class B why 254 2^7 + 2^6 + 5 + 4 + 3 + 2 + 1 + 0 1+2+4+8+16+32+64+128 = 255   special numbers: 0 - a whole network public address and priv