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
2. Then, click on the services and then click on EC2
3. After you do that, then click on Instances. You will see nothing there because you have not created anything.
4. After you are in instances, then click on Launch An Instance.
5. Once you have finish clicking on launch an instance, then click on Amazon Linux FREE TIER 2 AMI.
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.
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.
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.
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.
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.
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.
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.
13. Click on the instance ID and you'll be at EC2 dashboard. You can see all running instances.
Connecting to your instance
1. Click on your instance and then click on Actions on the top and then click on Connect.
2. There are three ways to connect the instance. The most popular one is the Standalone SSH client.
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.
Creating a Website
1. Install apache httpd package
2. Create a simple webpage and start the web service.
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).
4. Go to your instance and click on security group.
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.
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.
2. Specify the size you want and click on create volume.
3. New volume is created. Click on the volume name and click on Attach Volume. Select your instance and then click on Attach.
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.
2. Create a partition of your disk.
3. Create a filesystem of your disk.
4. Mount your partition.
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
2. Next click on actions
3. Then click on Instance Settings and then click on terminate the instance and your done!
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.