Monday, September 15, 2008

Seam on Amazon EC2

I just completed putting up a demo of my seam work on Amazon Web Services EC2 service. I primarily did this to ground my advocacy of EC2 as a good option for small biotechs that may need occasional bursts of compute power but have neither the cash to buy adequate servers for peak compute load nor the staff to maintain them.

I thought that putting up my jboss/seam/mysql demo would also be sufficiently non-trivial to give me a good feel of what it is like.

There are similarities between EC2 and other virtualization options (EC2 is based on XEN after all).

The core differences in my mind revolve around having S3 as a backing store. Since S3 is on Amazon's servers you need to pay more attention to security keys etc.

My recommendation is the go through the Getting Started Guide -- even to the point of saving a modified image. This will assure that you have the proper accounts set up both on EC2 and S3 and you have a bucket set up on S3 for storing your image.

I found it easiest to create a bucket using the Python examples -- even though I have never done much more than a "hello world" program in python (yes one that consists of
#!/usr/bin/env python
print "Hello World"
). The python code is the most self contained and required the fewest downloads of ancillary libraries in my environment (Apple OSX 10.5.4)


Building and saving an image takes a while -- I would recommend doing a reboot of your virtual machine to make sure that all of the changes take hold (boot processes start as designed etc.).

Not to overstate the obvious, but the image that you start with has a tremendous impact on the time it takes you to get up and running. I settled upon an image that already had mysql5, jboss 4.2.2 installed, and it made things much easier. In general I didn't feel that the images were particularly well documented. Not being that familiar with Fedora I thought that the difference bettween the Fedora-core-4 and fedora-core-8 was how many CPU cores they were optimized for, not the revision number. My initial foray with the fedora-core-4 image stopped when I realized that it had mysql4 rather than mysql 5.

All in all the experience wasn't too bad (I don't think that I could ever call one of these experiences "good" -- if it were good I would just be able to click a "do it" button that would do exactly what I wanted), and would have been much better if I hadn't "lost my keys".

2 comments:

Chris said...

You might be interested in Cloud Tools (http://code.google.com/p/cloudtools), which is an open-source framework for deploying Java applications on Ec2.

rdf said...

Thanks, that looks like an interesting starting point.

It would probably be better than the ami I chose if my seam install was configured to run on tomcat rather than JBoss.