AWS: Amazon Web Services
EC2 stands for "Elastic Compute Cloud". This allows running a remote virtual machine instance in the AWS cloud. The remote machine can choose to have OS windows or Linux(redhat, suse, ubuntu or amazon's linux). The remote machine instance can be-
1. General Purpose
2. Compute optimized
3. GPU instance
4. Memory optimized
5. Storage optimized
AWS basics:
For launching an existing EC2 instance,
1. Click on EC2
2. Click the instances link @left panel.
-> This shows the list of instances
3. Select the instance and click on the "Actions" drop down at the top
4. To start/stop the instance, select the "instance state" and change the state.
Connect to EC2 from Linux:
Run the following command to login to the remote machine instance-ssh -i "ec2-keypair.pem" ubuntu@
Where ec2-keypair.pem is the private key file
Troubleshooting:
1. Error:
ssh: connect to host port 22: Connection timed out
a. Click the "security group" link @left panel.
-> This shows the list of security groups
b. Right click on your security group and select "Edit inbound rules"
c. Make sure that your public IP is added as "custom IP" and give IP address as xx.xx.xx.xx/32
Connect to EC2 from Windows:
Setting up EC2 with nodejs:
Follow this link for setting up the EC2 instance for node.js-
http://therightchoyce.tumblr.com/post/37209565860/installing-nodejs-on-an-ec2-ubuntu-instance-for
Test out the node.js with the following hello world program:
var http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type":"text/plain"});
response.end("Hello world");
});
server.listen(8000);
console.log("Server running on 8000");
Save the file to example.js and run with
nodejs example.js