Introduction to EC2
EC2 intro

Introduction to EC2

Today we discussed about EC2. What is EC2? EC2 is a web service that provides secure, re-sizable compute capacity in the cloud. Basically its a service that allows people to rent VM's (Virtual Machines) that can compute power, storage space, and network connectivity running presently on AWS’s infrastructure.

How to create an EC2 instance

1. Login to the AWS management console

No alt text provided for this image


2. Then, click on the services and then click on EC2

No alt text provided for this image


3. After you do that, then click on Instances. You will see nothing there because you have not created anything.

No alt text provided for this image



4. After you are in instances, then click on Launch An Instance.

No alt text provided for this image


5. Once you have finish clicking on launch an instance, then click on Amazon Linux FREE TIER 2 AMI.

No alt text provided for this image


6. After selecting an Amazon Machine Image (AMI) then use the General Purpose t2 micro FREE tier if you don't want to spend any money. Note: Even the t.2 nano is not in the free tier, even when it is smaller than the free tier.

No alt text provided for this image


7. Once you have completed with choosing your instance type, then go to Configure Instance Details. You really don't need to do anything here so just click Add Storage.

No alt text provided for this image


8. You don't need to do anything in this part. You can leave the storage as is. And you don't need a volume.

No alt text provided for this image


9. Once you are done clicking to the next part which is tags, you can create a tag but you don't have to. It's just an informational type of tool that you can define by a Name and Value. The maximum amount of tags you can have are 50 tags.

No alt text provided for this image


10. After you have completed clicking on the next button, you'll see Configure Security group. You can leave it as is. There will be a warning but its fine. If its really secret then I recommend not doing it.

No alt text provided for this image


11. Review your launch before launch. After you have confirmed doing your launch, then you'll be asked to make a key or use a previous key. I recommend use a previous key but if you don't have one then its really easy. You download it and do other steps.

No alt text provided for this image


12. If you have done the whole process correctly, you should see this. This is the sign that means you have done well. You can now use the VM. Now you can click on instances.

No alt text provided for this image

13. Click on the instance ID and you'll be at EC2 dashboard. You can see all running instances.

No alt text provided for this image

Connecting to your instance

1. Click on your instance and then click on Actions on the top and then click on Connect.

No alt text provided for this image

2. There are three ways to connect the instance. The most popular one is the Standalone SSH client.

No alt text provided for this image

3. Copy the command from the example section and paste on your terminal. I am using Ubuntu which comes with terminal which I can use to connect to remote host. Mac also comes with Pre-Installed SSH. For Window's computer, you can use MobaXterm or git bash.

No alt text provided for this image


Creating a Website

1. Install apache httpd package

No alt text provided for this image

2. Create a simple webpage and start the web service.

No alt text provided for this image

3. Go to your browser and try to access your page using your IP address. You cannot access it because of firewall. You have to enable httpd on firewall(security group).

No alt text provided for this image
No alt text provided for this image


4. Go to your instance and click on security group.

No alt text provided for this image
No alt text provided for this image


5. Click on your security group and click on inbound rule. Click on add rule and select http. Now you should be able to access your webpage/website.

No alt text provided for this image


Creating volume(disk) and assign to a host

1. Go to your EC2 dashboard and click on Elastic Block Storage from left menu. Click on volume and click on Create Volume.

No alt text provided for this image
No alt text provided for this image

2. Specify the size you want and click on create volume.

No alt text provided for this image

3. New volume is created. Click on the volume name and click on Attach Volume. Select your instance and then click on Attach.

No alt text provided for this image

4. Now the device is attached to the instance.

Creating file system

10. Login to your O.S instance and run fdisk command to see your disk.

No alt text provided for this image

2. Create a partition of your disk.

No alt text provided for this image

3. Create a filesystem of your disk.

No alt text provided for this image

4. Mount your partition.

No alt text provided for this image

How to kill your instance

There are many ways but by far the easiest and simplest is to terminate the instance. This is the way to do it.

1. Click on the instance that you want to kill/terminate

No alt text provided for this image

2. Next click on actions

No alt text provided for this image






3. Then click on Instance Settings and then click on terminate the instance and your done!

No alt text provided for this image






Here are some basic terms that you'll need to know:

1. AMI - Amazon Machine Image - AMI is a special virtual appliance used to launch instances and operating systems, device mapping, root volume template, and launching permissions.


2. Auto Scaling - Auto Scaling is the ability to scale up and down quickly and easily match server load.


3. Instance - Instance is a server, that when its created, functions as many other servers or other operating systems.


Summary: In this article, we have learned about is how to kill instances, creating file systems, creating volume(disk) and assign to a host, creating a website, connecting to your instance, and finally creating an instance in EC2.

NAS devices have limitations - while they may be suited for a purpose, it is also essential that NAS implementation partner is competent - unfortunately many are not. Have seen businesses that have lost data even after having sophisticated NAS box. NAS boxes also get infected by ransomware that can mutate and spread to data, so implementation is the key. If a business cannot spend for implementation, they would be better off copying data on harddisks on a daily basis. There are many free software available for that. Also for businesses that do not use SQL and rest, they can use free servers such as BLACKBOX Data Safe for which even installation videos are available and the company provides support on chargeable basis. IF you NEED it, that is, else it is free for use, forever, for as many users and as much time.

Like
Reply

To view or add a comment, sign in

More articles by Sam Bhusal

  • AWS Questions - 10/6/2021

    What is Cloud computing ? Cloud computing is the distribution of computing services like storages, databases, software,…

  • Day 5 Python

    Day 5 Python How to be successful in python? To practice and practice. Programming using variables What is variable?…

  • Python Day 2

    Python Continued..

  • Day 3 of Flutter

    Dart pad debug console and terminal instead of just writing print Life is beautiful 3 times like this print("Life is…

  • Day 14 of flutter class

    1)What is statelesswidget ? A stateless widget in flutter is is defined as any widget which changes its state within…

  • JSON and API, etc …

    What is API and how to create own API? The set of functions and procedures allowing the creation of applications that…

  • Day 1 of AWS 10/12/2020

    What is Cloud computing ? Cloud computing is the distribution of many distinct services. How AWS cloud is different…

  • Day 1 Intro to Python

    Day 1 Session 1 Before beginning Python we should first address some questions that generally arouse in first time…

  • Intro to Linux/Unix 3/21/2021 Overview

    Chapter 1 The Standard Boot process for PC Power to Computer The Basic Input/output system (BIOS) is read from a chip…

Others also viewed

Explore content categories