Open satish8450 opened 8 months ago
**Elastic Block Storage"**
EBS : Additional Storage for server
Types : Block storage (Storage area Network SAN) -->EBS Files storage (Network Attached Storage NAS) --> EFS Object storage : S3 EBS: Create EBS for Instance and attach, in server we need to create partition, Make file system, mount Create Volume : HDD is mechanical drive but it is very slow , clod HDD,throuput HDD, standard SDD is solid state disc very fast , eg: pendrive, Once volume is created please attached to required instance
Login to server : run df -h command we can't see attached volume becoz we haven't mounted that if we run lsblk command we can mountable volumes all our storage volumes we be attached to /dev file system Mounting : Create one directory mkdir vol1 under root
#mount /dev/xvdf /vol1 --> mounted
#umount /dev/xvdf /vol1 --> unmount it will detach from server
df -h we can able to see another drive /dev/xvdf
Snapshot : Snapshot is mainly used for creating volume copy, , this snapshot of volume we can transfer to another region then we can create volume from this snapshot and attach to instances
Life cycle Manager : by using this we can create volume or snapshots by the basis of schedule
Elastic load balancer ( ELB)
This will use for divert traffic
Types : Application load balancer : its path based routing inside the application we will use this for divert traffic Network load balancer : it will work for Applcaition home/launch page traffic route
Network load balancer Setup
Create two servers which is under Same VPC both servers having same application(nginx) running on it
For the dirrenetiate the how traffic is diverting , do some code modifications in both nginx servers
cd /usr/share/nginx/html hers index.html
Goto load balancer
choose : Network Load balancer
Load balancer name : give name
Network mapping : Choose VPC and subnets
Security groups : choose SG
Listeners and routing : Target Group ( We need to create target group for above web servers then only NLB will identify where traffic need to go)
Create target group
Choose a target type : instances
Target group name : NAme
Protocol : TCP :80
VPC : choose VPC
Next
we need to select what servers are grouping
Create TG
Listeners and routing : Choose TG from Above
Create NLB : Here we will have DNS id, Browse the DNS id We can able to see any one of our application
Route53 : will convert DNS id to conventional name to remember
Application Load balancer
ALB
Inside the applciation we can divert the traffic by the basis of path based Goto load balancer choose : Application Load balancer Load balancer name : give name Network mapping : Choose VPC and subnets Security groups : choose SG Listeners and routing : Target Group ( We need to create target group for above web servers then only NLB will identify where traffic need to go)
Create two separate TG for each server and associate with webserver TG1 is associated with Webserver1 Create Application Load balancer if we browser it wont work, we need set a path Goto TG1--.listiner--> manage rule --> add rule set path as music condition : path path is /music/* --> next Forward to target group if we browse ALBid/music we can able to see music web page
Auto Scaling :
This will create the servers on the basis of load on actual server or increase the capacity of the server
Types:
Horizontal scaling : it will deploy another server along with exsiting servers.( no of servers will increase) Vertical Scaling : it will increase server capacity (t2 to m5)
Setup :
Launch the server and install the application Create Network load balancer for the server Create Target Group Here our application will having load balancer
Creation of Autoscaling Group
Create Autoscaling group
Name : Name the Autoscaling
Launch template :
Create template form instance and use
Launch template name: name of the templete remianing all fields will taken by automatically
Choose instance launch options:
select VPC,Availability Zones and subnets -->Next
Load balancing :
Attach to an existing load balancer: Choose from your load balancer target groups --> choose TG
VPC Lattice integration options : No VPC Lattice service --> Next
Configure group size and scaling:
Desired capacity : 1
scaling : How many server we want to scale min and max
Automatic scaling - optional
Target tracking scaling policy: Here we need to select to when autoscaling need to exist
Create Autoscaling
Name : Name of the instance Application and OS Images (Amazon Machine Image) : AMI we will use for OS Instance type : What kind of memory, networking, or storage needs. t2.micro is for free tire, real time will use m5.xlarge max , t2.medium min. Key pair (login) : PPK or pem to login to server Network settings : Will provide VPC,Subnet,Auto-assign public IP,firewall (security groups),
Advanced network configuration: After selecting VPC&Subnet we can able to see this Here we can attach two servers to single server, For example we have db server , if you want to store Data we can create sub server of DB server under Same VPC that .we can insert here Network interface 1 : give storage server details here we can interlink
Configure storage : we have attach additional storage to server for that we need to create EBS Volumes and attach File systems : EFS in instances we can upload the data via files by using EFS Instance Template : We can create template for instance which is having all required fields like vpc,subnet,SG,NAT
Spot Instance : It is cost efficient comparing to OnDemand server, for ex: we have server running in different AZ in that 70% used for general purpose ,20% is used for future requirement , remaining 10% will used for create spot instance . AWS will use this 10% will create Spot instance , it will destroy at any time Jumpservers will created on this spot instance
Reserved Instance : We can use instance for years we can buy basis on years