You are on page 1of 6

AWS-CLASS: 22nd September 2022

TOPIC:1 -> AMI: Amazon machine Image


 Security groups-network security.--> Need to learn on own

NGINX: NGINX is open source(Now taken by Amazon) software for web serving,
reverse proxying, caching, load balancing, media streaming, and more. It started
out as a web server designed for maximum performance and stability. In addition
to its HTTP server capabilities, NGINX can also function as a proxy server for email
(IMAP, POP3, and SMTP) and a reverse proxy and load balancer for HTTP, TCP,
and UDP servers.

We Use Nginx for making Backup of files and applications or Instances.

Install nginx in linux:


Commands:
1. yum install nginx --->will not work because amazon will not allow to do so
2. sudo amazon-linux-extras install nginx1 -y
3. service nginx start
4. service nginx status
Once the server is rebooted: nginx will be dead. (INACTIVE)
But we can make it constant active by using command: systemctl enable nginx
After This command, though the system is rebooted then nginx will be still
alive(ACTIVE).

STEPS:
1. Go to instances in AWS EC2
2. Go to Actions ----> Image and Template ----> Create Image
3. Give Image name. (like: ngnix Backup, etc)
4. Wait for Image status to be “Available”
5. Now Terminate the AWS EC2 Instance created in step 1.(Instance with
nginx installed)
6. Create a new Instance in AMI (Not in EC2) so that we can access the backup
from AMI nginx directly.
7. Now in that instance the nginx will be automatically in ACTIVE stage.
8. After the usage of AMI, go to actions and Deregister AMI for avoid billing.

TOPIC:2 -> Changing Volume.


Default Memory allocated:

AWS-LINUX: root volume 8GB

WINDOWS: root volume 30GB

Note: Volumes is available in option on left panel.--> Modify Volume

We can Only Increase the volume, but we can’t decrease the volume
of instance.

STEPS:
1. First create an instance normally.
2. Volume Type:
a. General purpose SSD(gp2)
b. General purpose SSD(gp3)
c. Position IOPS (Input Output Per Second).
3. Make sure the instance region and availability zone(Mumbai, Ohio)
4. Now create volume.
5. You can see the new volume in volumes interface.
6. Not we must attach the volume to instance.
7. Go to Actions ---> Attach Volume

Go to Instance(Putty)

Commands:
1. ec2-user
2. sudo su
3. cd /
4. lsblk (To check volume of Server)
5. df -h (shows partition of the storage in server)
6. mkfs -t ext4 /dev/xvdf --> XVDF is volume label that you see in above
command result. (For formatting the disk)
7. mkdir filename
8. mount /dev/xvdf (filename)/
9. lsblk
10.df -h

NOTE: Through this method if we reboot the server we will loose the
volume after the reboot. This is because the memory is not attached
though mounted to server.

To make the mounted file constant, we should attach the mounted


file.

STEPS:
1. reboot
2. mount /dev/xvdf (Filename)/
3. lsblk
4. df -h
5. To attach: vim /etc/fstab
6. VIM will open: Vim commands:
a. i --> INSERT MODE
b. /dev/xvdf /(file name) ext4 defaults,(nofail or notime) 0 0
--->ext4 is extension.
c. {Esc --> Shift+zz} or {:wq!} ----> TO save and close
7. Mount -a
8. Lsblk
9. Df -h
10.Cd (File name)
11.Touch f1 f2 f3 f4
12.ls
13.cd /
14.reboot
15.lsblk (You can observe that the volume mounted is constant)
16.df -h

Here we are mounting the path so that we can attach the volume to the
instance forever.

We can also detach the volume form the instance again.(Need to see
commands)

UMOUNT Volume:

Command:
1. umount /(filename)
2. lsblk

TOPIC:3 -> Backup of Volume.


Original Volume--5GB

Volume from Snapshot--7GB

Snapshot ---> Used for taking the Backup of volume.

STEPS:
1. after unmounting it.
2. Go to Volumes Interface.
3. Go to Actions ---> Create Snapshots
4. Go to Snapshot Interface.
5. Go to Actions ---> Create Volume from Snapshot
6. Give some memory that is greater than original volume.
7. Then you will see a new volume in volumes interface.
8. Then follow the same as before (Creating the volume).
Go to Instance(Putty)

Commands:
1. ec2-user
2. sudo su
3. cd /
4. lsblk (To check volume of Server)
5. df -h (shows partition of the storage in server)
6. mkfs -t ext4 /dev/xvdg --> XVDF is volume label that you see in above
command result. (For formatting the disk)
7. mkdir filename
8. mount /dev/xvdg (filename)/
9. lsblk
10.df -h
11.cd (Filename)
12.ls (You will see all files in this from snapshot backup)

TOPIC:4 -> Life Cycle Management.

This gives the Backup period.

NEXT WEEK: Load Balancer --> Application load Balancer and Network
load Balancer.

You might also like