EC2 running notes and pratical implementation
EC2 running notes and pratical implementation
EC2 Service
============
=> EC2 instance is re-sizable (we can change configuration based on demand)
=> For EC2 vm creation we will use AMI (Amazon Machine Image)
- Windows AMI
- Ubuntu AMI
- RedHAT AMI
=> To allow incoming and outgoing traffic for EC2 we will use Security Group
Note-1 : One Key Pair we can use for multiple EC2 instances
Note-2 : One Security Group (SG) we can use for multiple EC2 instances.
===========================
===========================
Linux SSH : 22
HTTP : 80
HTTPS : 443
MySQL : 3306
- Select AMI
- Create it
===============================
1) private ip
2) public ip
3) elastic ip
=> Private IP is a fixed IP in AWS. It is used for internal communication (With in VPC)
=> public ip is a dynamic IP in aws. It is used to connect with EC2 VM from outside.
==============================
=============================
==============
What is EBS
==============
=> EBS provides both primary and secondary storages for EC2 instances
- Root Volume
- Additional Volume
Ntoe: When we launch EC2 instance by default we will get one Root volume.
=> If we remove root volume from EC2 then we can't start/use that instance.
=> Additional EBS volumes are optional devices (we can add/remove)
=> For windows VM, we will get 30 GB as default volume size.
Mumbai (ap-south-1)
=> ap-south-1a
=> ap-south-1b
=> ap-south-1c
=> If EC2 VM is created in ap-south-1a then our EBS volume also should be there in ap-
south-1a then only we can attach it.
====================
===================
=========================
=========================
1) Create EC2 VM (VM-1) (amazon linux ami) - we will get EBS root vol 8 GB
Note: Now EC2 Vm-1 will have 2 EBS volumes (root vol + additional vol)
$ lsblk
4) Store data (files) into EBS Additional Volume using below commands
$ mkdir dir1
$ cd dir1
6) Create New EC2 VM (VM-2) and attach EBS Additional Volume to EC2 VM-2
$ lsblk
$ mkdir demo
$ ls -l demo
Note: Once practice is completed, detach additional volume and delete it to avoid
billing.
==========
Snapshots
=========
=> From volume we can create snapshot & from snapshot we can create volume
Note: Snapshot can't be attached to EC2 instance directley (volumes can be attached
to EC2 instance).
=========================================================
=========================================================
=========
Website
=========
- static websites
- dynamic websites
Ex: gmail
====================================
====================================
$ cd /var/www/html
$ sudo vi index.html
=================================
=================================
sudo su
cd /var/www/html
=========================
=========================
=> When we run our application in single server then we have to face below challenges
6) Business Loss
=> To avoid above problems, we will run our application using Load Balancer.
=> Load Balancer is used to distribute load to multiple servers in round robbin fashion.
4) Fast Performance
5) High Availability
=======================
=======================
sudo su
cd /var/www/html
#! /bin/bash
sudo su
cd /var/www/html
(it will route the requests to our servers in round robbin fashion)
===============================
Monolithic Vs Microservices
===============================
==============
OSI Model
==============
=> OSI model represents how request will transfer from client to server
Advanced routings
Firewalls
VPNs
High Security
=====================
=====================
=> If requests are increasing then servers should be increased and if requests are
decreasing then less servers should be handling the request
1) Fault Tolerance
2) Cost Management
3) High Availability
=> Launch Template is used to specify configuration required to launch new VM.
===============================================================
===============================================================
=========================================================
=========================================================
====================
====================
1) General Purpose
2) Compute Optimized
3) Memory Optimized
4) Storage Optimized
5) Accelerated Computing
============
EC2 Summary
============
1) What is Ec2
2) AMI
8) Types of IPs
9) Launching Windows VM