Friday 13 February 2009

ec2onrails EU

Well, necessity is the mother of invention. We needed new FilmAmora servers to deal with the increasing load. I also wanted to move to EU-based EC2 instances.
That meant rolling our own because I believe there are no publicly available ec2onrails instances that run in the eu-west region.

This was not as easy as I would have liked, so here's a little step by step.

1. Go to Alestic and get the id of the proper eu instance. (At this writing it is ami-ac032bd8)

2. Fire up an instance of this. I use Elastic Fox and you need to set the region to europe then choose this instance.

3. copy your pem's into the instance:
scp -i IDENTITY {cert,pk}-*.pem root@HOSTNAME:/mnt/


4. ssh into the instance
ssh -i IDENTITY root@HOSTNAME


5. Get the build script
wget http://ec2ubuntu-build-ami.notlong.com


6. update so you can get git
apt-get update && apt-get upgrade -y


7. get git
apt-get install git-core


8. get ec2onrails and use the latest branch
git clone git://github.com/pauldowman/ec2onrails.git
cd ec2onrails
git checkout --track -b 0.9.9.1 origin/0.9.9.1


9. Run the build script!
 bash ec2ubuntu-build-ami \
--script /root/ec2onrails/server/build-ec2onrails.sh \
--user YOUR_ACCOUNT_NUMBER \
--access-key YOUR_ACCESS_KEY \
--secret-key YOUR_SECRET_KEY \
--bucket BUKCET_NAME \
--prefix PREFIX \
--location EU


Your account number is the 12 digit number from your amazon access information page.

10. Register the instance
ec2-register bucket/manifest.xml --region eu-west-1


That's it!
You should now be able to go to Elastic Fox and launch and instance of this that will be in Europe!

No comments: