The Amazon Ec2 cloud service is great. Even though I have access to a few rather large boxes the idea of having as many compute servers as I like within minutes is very exciting. Amazon also recently announced the high memory instances which give you 68 GB of memory, I shifted in my chair as I wrote that. Still one of the issues is sifting through the Amazon documentation and multitude of tools to get up and running to the point where you have ssh’ed into your machine and are ready to have it serve your will. Here I present a quick way to get from having just heard of the Amazon Ec2 service to being at the console of your first Ec2 instance. This article assumes you are running some form of linux.
What is Amazon Ec2?
The Elastics Compute Cloud (Ec2) is an Amazon Web Services (AWS) offering which let’s you start remote computers and have them do whatever you want done.
What is an AMI (Amazon Machine Image)?
An AMI is a snapshot of a machine. Imagine taking check-pointing everything in your machine right now and then being able to load it exactly as you left it on multiple computers. Thus, when you start a machine on Ec2 you actually load an AMI, the snapshot of some system taken by someone (either Amazon, or some other trusted source).
What is an Instance?
An instance is a running machine. There are different types of instances and instances differ in the hardware available like memory, cpu’s etc.
Now let’s dive into getting up and running on the Amazon Cloud!
Get an amazon Ec2 account
You will need:
1. A credit card – to pay for the machines you start up. The machine we will start here costs between 8 and 10 cents per hour. There are also some data transfer charges but for the purpose of this article your cost will be in the same order.
2. An email address and telephone- if you have ever ordered through Amazon you can use the same email address. They will verify some details and you’re done.
Go here and click “Sign up for Amazon Ec2.”.
Launch the machine
1. Go to the AWS console (click here) and click “Launch Instances”.
2. Choose AMI- On the pop up screen click on the “Community AMI’s” and in the text box enter the AMI you want to launch. The Analytics1305 AMI can be found here and when you enter it you will see our AMI (Notice that the ami id is subject to change so always look at this page to find out the latest one). Then click “Select”.
3. Create Key Pair- In the next step you will be asked to enter the name of your key pair. If you have never created one click on “Create and Download Key Pair”. Let us name the key pair “gsg-keypair”, put that in the text box. You will be asked to download a file called “gsg-keypair.pem”, Download it and keep it somewhere safe. You will only need this file when you actually ssh. Also, you should change the permissions on the file.
The command “chmod 0600 gsg-keypair.pem” should do the trick.
4. Configure Firewall- In the next step you will be asked to name a security group. Click on skip this step at the bottom.
5. Launch – Now you get to the final screen before launch. Put 1 in the “Number of Instances” box and select gsg-keypair in the “Key Pair Name” drop down. Also select and “Instance Type” as small (the default). Also select “Security Group” as “default”. Click launch.
Click “Close” on the message screen.
Now in the console click “0 Running Instances”. You should see the instance you have launched “starting” or “pending”. This means the machine is booting up. Give it a minute or so and it will go to “running” state. You can refresh your browser to see the current state.
Click on the instance you just ran and in the information that shows up below look for the “Public Dns”. This will look something like ec2-133-122-188-111.compute-1.amazonaws.com. Note this down.
SSH into your machine
1. Now you need to enable ssh on the machine. Click on “Security Groups” on the left pane of the console. Click on the “default” security group.
2. At the bottom there will be information displayed about the group. Click on the drop down box that says “Custom…” and select “SSH” and then click “Save”.
3. Finally you can ssh into the machine. From the console type:
ssh -i <path to gsg-keypair.pem> a1305@<Public Dns of machine>
When it asks you to verify the RSA key finger print type yes and return. Congratulations. You are now logged into an Amazon Ec2 cloud machine with Analytics1305 libraries pre-installed.
To terminate the machines. Select the machine in the console by clicking the checkbox next to the machine. Then click “Instance Actions” and then choose “Terminate” from the drop down menu. Click “Yes, Terminate”. The machine’s status in the conslole will go to “shutting-down” and eventually “terminated”.
For questions and support send and email to cloud@analytics1305.com or post on the forum.
if you want a simpler way to connect follow this instructions http://analytics1305.com/blog/?p=31