EBS
Class 47th AWS ECB June 17th
Elastic Block store -EBS (Ec2,RDS these are resouces data will store in EBS)
File Storage -->EFs ,fsx
Object Storage -->S3
Block level Storage -->EBS
It has no structure.
It can host operating system
It is bootable and mountable
Ex: Elastic Block store(EBS)
- Booting is the process of starting up the entire system and loading the operating system
- Mounting Is the process of attaching a file system to the directory structure of an already running operating system,make it accessible for use
- IOPs Measures the number of read and write operations a storage system can perform per second. (SSO hard disk we choose usually Iop,through put is high)
- Throughput Measures the amount if data transferred to and from a storage system per unit of time, typically expressed in megabytes per second(MB/s) or gigabytes per second(GB/s)
- The EBS volume is a durable,block level storage device that you can attach to you instances.
- After you attach a volume to an instance,you can use it as you would use a physical hard drive.
- EBs volumes are persistent,meaning that the data stored on them remains intact even after the Ec2 instance is stopped or terminated.
- We can encrypt the volumes using AWS KMS.
- Volume size can be in between 1 GIB to 16382 GIB(1 GB=0.9313 GIB).
- Per each 1 GIBm3 IOs will be allocated .Maximum 16000 IOPS can be allocated per each volume.
- Up-to 33GiB (gibibyte)100 iOps will be allocated, after each 1 GIB 3 IOPS will be added.
EBS Architecture
EBS volume mount and unmount (Linux & Windows)
Snapshots
Life cycle manager
Practical :
For the instance you can able increase the volume , but you can not decrease the volume which was assigned already
Step1: Created three instances
Create Volume:
Ec2>Volumes >Create volume with 1 GB space
As see below Three volumes are in-use those are all out three Ec2 volume used,1 GB space we have create volume showing available , you can attach these volume any of the instance.
Select the available volume >action attach the volume, as you see below ,we have created two instances same available zone ,so the reason came instance in the list
Select any instance for two instance1,instance2, devicename just label you can select any then click attach volume
Existing 1GB volume Click create snapshot ,Give any description name "snapshot_volume" click create snapshot.
See below the snapshot moved to Mumbai region ,with this we can able create volume and attach the instance where every you required.
Public and private snapshots
Amazon Elastic Block store(EBS) snapshots can be managed as either private or public depending on how you want to share or restrict access to them
By default, all EBS snapshots are private,meaning they can only accessed by the AWS account that created them.
Aws provides the ability to share EBS snapshot with specific Aws account or make them public so that any AWS user can access them.
1.Private EBS snapshots(default)
2.Public EBS snapshots
3.Sharing EBS snapshots.
Summary of public vs Private snapshots
Feature |
Private snapshot |
Public snapshot |
Access |
Only the owner account can access |
Accessible by anyone with an aws account |
Default setting |
yes |
No |
Visibility |
Only to the account owner |
Visible to all AWS users |
Sharing |
Can be shared with specific AWS account |
Available to all AWS users globally |
Use Cases |
Backups,recovery,internal sharing |
Public AMIs,software distribution,public data sets |
Consideration when making a snapshot public
Data security: Once a snapsot is public,anyone can acces it, so it’s crucial to ensure that it doen’t contain sensitive or personal information.
Costs:While sharing a
snapshot does not incur additional costs ,any data transfers or new volumes
created from the snapshot will result in charges.
Public snapshot use cases: Public AMIs for software vendors,public datasets for research or analytics, or community-shared resources.
Snapshot we can able to take backups also using Lifecycle manager
Elastic File system (EFS)
What is the file storage system
A file storage service is a type of data storage system that allows users and applications to store,manage and access files in a hierarchical structure of directories and subdirectories.
This service is often used for storing unstructured data,such as documents,images,videos,and other file types,and allows for easy access and sharing of files across different devices and users.
Typically it is not suitable for hosting the operating system
File storage service are fundamental for many organizations,as they provide a convenient and organized way to manage and access files,whether on-premises or in the cloud
For ex:- usually our project related files commonly store shared drivers ,in EBS we don't have that option for that in aws Linux we have Elastic file system, for window fsx
Step1:create two linux instances ,in public subnet
Network ,Choose your VPC and available zone, here We are planning to creating Mount target, mount target files will plan to attach the our two instance which was created. i.e Shared files, those two instances.
Policies optional not select any click next Next Click Create
Complete!
Is this ok [y/N]: y
Complete!
Creating one directory
[root@ip-10-0-1-62 ~]# mkdir ccit
[root@ip-10-0-1-70 ~]# mkdir ccit
Step 3: here we give our folder name, run these command to our servers
sudo mount -t efs -o tls fs-039d118041cebdc3f:/ ccit
Step4: Getting some error ,we have DNS hostname enable in the VPN
[root@ip-10-0-1-62 ~]# sudo mount -t efs -o tls fs-039d118041cebdc3f:/ ccit
Failed to resolve "fs-039d118041cebdc3f.efs.eu-west-2.amazonaws.com" - check that your file system ID is correct, and ensure that the VPC has an EFS mount target for this file system ID.
See https://docs.aws.amazon.com/console/efs/mount-dns-name for more detail.
Attempting to lookup mount target ip address using botocore. Failed to import necessary dependency botocore, please install botocore first.
Step5: Enable DN hostname check,previousily it was unchecked that click save if required .
[root@ip-10-0-1-62 ~]# mount -t efs -o tls fs-039d118041cebdc3f:/ ccit
[root@ip-10-0-1-70 ~]# mount -t efs -o tls fs-039d118041cebdc3f:/ ccit
Step6 : i have created one touch file in ccit server 2, the file came automatically server1,
so here mount was ccit mount both the instance, that means shared folder for the both instances
Server 2:
[root@ip-10-0-1-70 ~]# cd ccit
[root@ip-10-0-1-70 ccit]# touch hello.txt
Server 1:
[root@ip-10-0-1-62 ~]# cd ccit
[root@ip-10-0-1-62 ccit]# ls -lrt
total 4
-rw-r--r--. 1 root root 0 Jun 19 19:02 hello.txt
Server 1:
[root@ip-10-0-1-62 ccit]# cat hello.txt
Server1 changes
Server 2:
[root@ip-10-0-1-70 ccit]# cat hello.txt
Server1 changes
Server 2
[root@ip-10-0-1-70 ccit]# vi hello.txt
[root@ip-10-0-1-70 ccit]# cat hello.txt
Server1 changes
Server2 changes
Server1
[root@ip-10-0-1-62 ccit]# cat hello.txt
Server1 changes
Server2 changes
Web Host Using second command efs
Server 1 :
Step1: here html page create one instance
[root@ip-10-0-1-70 ccit]# sudo yum install -y httpd
[root@ip-10-0-1-70 ccit]#sudo systemctl start httpd
[root@ip-10-0-1-70 ccit]#sudo systemctl enable httpd
[root@ip-10-0-1-70 ccit]# sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-039d118041cebdc3f.efs.eu-west-2.amazonaws.com:/ /var/www/html/
Server 2:
[root@ip-10-0-1-70 ccit]#sudo yum install -y httpd
[root@ip-10-0-1-70 ccit]#sudo systemctl start httpd
[root@ip-10-0-1-70 ccit]#sudo systemctl enable httpd
[root@ip-10-0-1-70 ccit]# cd /var/www/html
[root@ip-10-0-1-70 html]# vi index.html
[root@ip-10-0-1-70 html]# cat index.html
<h1> welcome Server1 Efs</h1>
[root@ip-10-0-1-62 ccit]# sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport fs-039d118041cebdc3f.efs.eu-west-2.amazonaws.com:/ /var/www/html/
[root@ip-10-0-1-62 ccit]# cd /var/www/html
[root@ip-10-0-1-62 html]# ls
index.html
[root@ip-10-0-1-62 html]# cat index.html
<h1> welcome Server1 Efs</h1>
No comments:
Post a Comment