IMPORT YOUR OWN RSA SSH KEY INTO AMAZON EC2

Recently, I needed to import my own RSA SSH key to EC2. Here is a quick way to import to all regions

NB: You need the ec2 tools set up before you can run this. You will also need to have setup an x509 certificate pair.

You can read more about the ec2-import-keypair command in the EC2 documentation.

Assign multiple security groups on Amazon EC2 Run Instances (ec2-run-instances)

Recently, I needed to deploy new servers with multiple defined security groups on AWS EC2 using CLI.

Note: Security groups can only be defined on instance launch unless using VPC.

Install s3cmd/s3tools Debian/Ubuntu

1. Register for Amazon AWS (yes, it asks for credit card)

2. Install s3cmd (following commands are for debian/ubuntu, but you can find how-to for other Linux distributions on s3tools.org/repositories)

3. Get your key and secret key at this link

4. Configure s3cmd to work with your account

5. Make a bucket (must be an original name, s3cmd will tell you if it’s already used)

Deploy Hadoop cluster with Ubuntu Juju

Here I’m using new features of Ubuntu Server (namely Ubuntu Juju) to easily deploy a small Hadoop cluster.

Add juju apt-repository:

Add charms NON-local:

Add charms local:

Generate your environment settings with

Then edit ~/.juju/environments.yaml to use your EC2 keys. It’ll look something like:

Bootstrap and then deploy charms NON-local

Bootstrap and then deploy charms local

Check Juju status:

Everything is finished and happy when

Optionally scale horizontally with datanode:

When all said and done: (SSH into namenode/datanode)