Toying with Amazons Elastic Compute Cloud (EC2)

Yay, I got my invitation to use the Amazon Elastic Compute Cloud last week :)
First of all i needed to active the Service, uploaded my X.509 certificate. Congratulations Amazon, that’s the way to do it!

It took me 30 minutes to get a zope instance running :)

After that I downloaded the ec2 tools extracted them to /opt/ec2-api-tools

You’ll need the following environment variables (on OSX):

export EC2_HOME=/opt/ec2-api-tools
export EC2_PRIVATE_KEY=~/.ec2/pk-batlogg.pem
export EC2_CERT=~/.ec2/cert-batlogg.pem
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
export PATH=”$PATH:/opt/ec2-api-tools/bin”

Then create a RSA key pair (i think the call stores the public key at amazon and shows you the private key):

/opt/ec2-api-tools-1.2-5692/bin/ec2-add-keypair lsa001-keypair

I saved it under the name id_rsa-lsa001-keypair

Here we go! Select an instance and start it.

ec2-describe-images shows some images to run:

IMAGE ami-5bae4b32 ec2-public-images/getting-started.manifest 206029621532 available public
IMAGE ami-68ae4b01 ec2-public-images/fedora-core4-base.manifest 206029621532 available public
IMAGE ami-69ae4b00 ec2-public-images/fedora-core4-apache-mysql.manifest 206029621532 available public
IMAGE ami-6dae4b04 ec2-public-images/fedora-core4-apache.manifest 206029621532 available public
IMAGE ami-6fae4b06 ec2-public-images/fedora-core4-mysql.manifest 206029621532 available public

let’s use the fedora-core4-base:

ec2-run-instances ami-5bae4b32 -k lsa001-keypair

after some minutes the machine was up and running:

ec2-describe-instances
RESERVATION r-b0d431d9 538162834475 default
INSTANCE i-c7b357ae ami-5bae4b32 domU-12-31-33-00-04-5D.usma1.compute.amazonaws.com running lsa001-keypair

open the firewall:

/opt/ec2-api-tools-1.2-5692/bin/ec2-authorize default -p 22
/opt/ec2-api-tools-1.2-5692/bin/ec2-authorize default -p 80
/opt/ec2-api-tools-1.2-5692/bin/ec2-authorize default -p 8080

ssh to the virtual host:

ssh -i id_rsa-lsa001-keypair root@domU-12-31-33-00-04-07.usma1.compute.amazonaws.com

that was easy :) now get zope up and running

yum install python
yum install subversion
yum install gcc
yum install python-devel
wget http://apt.ling.li/rpms/python-imaging/python-imaging-1.1.5-1.li.fc4.i586.rpm
yum install tk
rpm -ivh python-imaging-1.1.5-1.li.fc4.i586.rpm

useradd -m zope-media
su - zope-media
svn co https://svn.lovelysystems.com/repos/……./teleport.mediaportal/trunk .
make
make run

That’s it :)

http://domu-12-31-33-00-04-5d.usma1.compute.amazonaws.com:8080/++skin++VOL/teleport.mediaportal

One Response to “Toying with Amazons Elastic Compute Cloud (EC2)”

  1. Lovely Systems webmachines — Lovely Systems says on December 11th, 2006 at 10:46 am

    [...] We successfully deployed our first Zope3 applications on the promising Amazon EC2 cluster. Since my first post in October a lot of things happened. I read a very interesting article about the Jeff Bezo’s Riscy Bet and i’m still convinced that this type of service will be the future of hosting. Finally I managed to create a Lovely AMI (Amazon Machine Image) based on Ubuntu 6.06.1 LTS to deploy our first application on EC2. I followed jjc1138 and dougwinter on the AWS (Amazon Webservices) forum and Flex in his development blog. here are some more notes (mostly to myself, but probably useful for other people too): [...]

Leave a Reply