AWS

Challenges of on-premises Data Centers:
  • Scaling of infrastructure
  • Time consuming
  • Expensive
  • Wasting resources
Cloud Service:
  • Any Service which is made available to the user via Internet based on the demand.
  • From a Cloud Computing provider’s Servers.
  • EC2 Instance.
Cloud Computing:
  • Cloud Computing is the delivery of computing Services-Servers,
    • Storage
    • Database
    • Networking
    • Software
  • Analytics and more over the internet.
Cloud Service Models:
  1. IaaS  (Host) -----------------------> Ec2
  2. Paas  (Build) --------------------->  EKS , RDS
  3. SaaS  (Consume) --------------->   Cloud Watch
Advantages of AWS:
  • Cost-Effectiveness ------------ Pay as you Go
  • Elasticity & Agility
  • Flexibility  & Openness
  • Security
  • Reliable & High Performance
AWS Global Infrastructure:
  • Regions -----------------22
  • Availability Zones ----55
How to choose the right Region in AWS?                  (Interview Question)
  • User/Customer Location
  • Pricing
  • Latency
  • Security & Compliance Requirement
  • Service Availability
Physical Machine:
Virtual Machne / Virtualization:

EC2:
  • EC2 provides scalable computing capacity in the AWS cloud.
  • EC2 enables you to scale up or down to handle changes in requirement.
Ec2 Types:
  • On demand
  • Reserved
  • Spot instances
AWS Storage Services:
  • Object Storage  --------------  S3 Bucket
  • File Storage  ------------------  EFS
  • Block Storage  ---------------- EBS
EBS :-----------  Elastic Block Storage
  • Elastic Block Storage
  • Each EC2 have EBS Volume as a root Volume (root file system).
  • It is really fast
  • It is relatively cheap.
  • Capacity of EBS is -------16TB / 16000GB.
  • EBS we can’t share with multiple machines (Instances).
  • We can’t share EBS volume with multiple Availability zones with in the Region.
  • The Server and EBS should be in same availability zone.
1. How to Create an Additional Volume ?

Create EBS Volume
Attach EBS Volume to EC2
Mount directory with EBS.
  • Elastic Block Store
    • Volumes
      • Create Volume
      • Volume type -------------(SSD Provisioned & General
  • size
  • Availability Zone
How to attach EBS to EC2 ?
  • select EBS
  • Action
    • Attach Volume
    • Instance ----------------(Select from the list)
  • Device name
    • For Root volume ------------/dev/sdg
    • For Additional EBS ---------/dev/sdf
  • go to Linux
  • lsblk

  • Since this is Raw Storage volume (Additional EBS Volume)
    • Create a file system
    • sudo mkfs.ext4  /dev/xvdf

  • create a folder and mount the drive
  • dh -h
  • mkdir/ebsdemo
  • sudo mount   /dev/xvdf   ebsdemo/   (unmount   /EBSVOL1)
2. How to migrate the data from one availability Zone to Another Zone?       (Interview Question)
3. How to migrate the data from one Region to Another Region?                     (Interview Question)
  • With help of snapshot we can do it.
  • EBS snapshots
  • Snapshots is nothing but backup of EBS Volume.
  • Periodically we can take a backup.
  • We can’t mount snapshot directly.
  • We have to create a volume from the snapshot.
  • Zone to Zone
  • Elastic Block Storage
    • Volume
    • Action
      • Create Snapshot
      • Create Snapshot lifecycle policy

    • Region to Region  (Snapshot)
    • Snapshot
      • Action
        • Copy
        • Destination Region

4. Can we update the EBS Volume type or Size while it’s in use?             (Interview Question)
  • Yes
  • We can change the type and increase the volume Size.
  • But we can’t decrease the size  (From 10 GB  to  5 GB)
5. If you lost your private key (.pem key) how will you recovery?            (Interview Question)
  • Where the Pem key information saved
  • .ssh/authorized_keys
  • We have to create a new EC2 in same availability zone, with new keypair.

EFS:  ------------- Elastic File System
  • EFS Native from NFS Implementation.
  • No need to manage NFS , AWS will manage NFS
  • Share file system
  • EFS is region level service.
  • Within the region irrespective of Availability Zone we can share Files.
  • Automatically it will increase the size of volume and deciares the size.
  • There is no limitation for store the data.
  • It will charged per GB.
























How create a EFS?
  • Services
  • EFS
    • Create File system
      • Name
      • Choose VPC
  • Mount to the instances (servers)
    • go to EFS
    • Select EFS from the list
  • view detais
  • Attach
  • You need to install client software ---------EFS Client or NFS Client
    • go to Linux machine
      • yum install nfs-utils –y ------------(Client Software)
      • apt install nfs-common -y --------(Client Software)
        • mkdir DemoEFS
        • sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-0d9dcaa49e2b2e1c5.efs.ap-south-1.amazonaws.com:/ DemoEFS
  • go to EFS (AWS)
  • Copy command and past in Linux
  • df -kh
  • Need to open port number (NFS Port - 2049)
  • .
  • If you want to share some static file over the same availability zone.
  • We can share files, images etc.,
  • If multiple servers should have access to the same content, then we can go for EFS.
  • go to another server (EC2)
  • Where you want to mount EFS.
    • go to linux
    • create a directory 
      • mkdir -----------------(efs_Testing)
      • go to aws
      • EFS
        • sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-0d9dcaa49e2b2e1c5.efs.ap-south-1.amazonaws.com:/ efs_Testing

S3 Bucket:

  • Object storage.
  • Scalable storage in the cloud.
  • S3 Bucket will access from the any region. 
  • But S3 Bucket storage will maintain in some Region.
  • Each object we will have a unique end point.
  • Other Aws accounts also can able to manage S3 bucket, using ACL (Access Control List).
  • No need to Mount.
    • Create S3 Bucket
      • Bucket name (Unique name)
      • Region
Without mounting how can we upload the data in S3 Bucket?
  • GUI ----------- Graphical User Interface
  • CLI -------------Command Line Interface
  • API ------------Application programing interface
  • SDK ------------Software Development Kit (Boto/Boto3, Python SDK for AWS )
  • IaaS Code -----(Terraform)      
    • By default S3 object not able to access to the public.
    • If you want to give the access to public.
    • First you must give the Bucket lever access and after that object level permission to give the public access.
Bucket Policies:
we can grant permissions to specific Applications (or)  specific IP address / range using bucket policies.

ACL:
Access Control List.
We can given  permissions to S3 bucket to another AWS Accounts.

ARN:
Amazon Resource Name.
Each AWS Resource will unique ARN.
ARN is used to identify AWS resources uniquely.
 
arn:aws:<Service_Name>: <Region_Name>: <Availability_Zone>: <Resource_Name/id>

Versioning in S3:
  • If i want to maintain all the versions of my object in S3 bucket.
  • By default S3 bucket will not maintain the versionig.
    • S3 bucket
      • Properties
        • Bucket Versioning
          • Enable ----------------- (By default Disable)
Storage Calsses in S3:
         Charges is based on object Size & Storage class       
    1.Standard
    2.IA
    3.RRS
    4.Glacier
  • Standard:
    • Standard storage class is by default.
    • The files which we are accessing frequiently we can maintain in standard storage calss.
    • So that out object is highly available and fast retrival.
  • IA:
    • Infrequent Access.
    • We can maintain files which we are not accessing freqently in IA.
  • RRS:  One Zone-IA
    • Reduced Redundency Storage.
    • Not critical & Re_Producatable data we can maintain in RSS.
    • Data will be maintained only in one zone (Only one copy).
  • Glacier:
    • We can maintain long term & archirved data in glacier for very less price.
    • But charges are applicable when you read the data.
    • It takes more time if you want retreive.
Object Lifecycle:
  • S3 Bucket
    • Lifecycle rules
    • Create Lifecycle rules
      • Name
      • Choose a rule scope
        • filter type
          • prefix
          • Object tags
Replication:
  • we can replication S3 bucket using replication rule.

  • Same Resion Replication
  • Cross Resion Replication
  • .
  • Versioning should be enable if you want to replication.
    • S3 Bucket
    • Management
      • Replication rules
        •  Creat Replication rules
          • Name
          • Choose a rule scope
            • Destination

1.What is the file (object ) limit in S3?
        5000 GB / 5 TB

2. What is use case for S3?
        Best places to maintain application logs.
        Best places to maintain your application images/documents/videos (Static Content).

3. What is Snow Ball?
        It's not a service, it's kind of a request.
        It's physical data transport solution.
        If you want to tranport huge data from cloud to on-premise (or) on-premise to cloud.
        




        











Comments

Popular posts from this blog

Linux

kubernetes