QueTwo's Blog

thouoghts on telecommunications, programming, education and technology

Amazon’s EC2 and ColdFusion / FMS

,,,,

This last weekend I finally had enough time to play with Amazon’s Web Services (AWS).  Amazon Web Services are a set of pay-for utilities that allow developers (among others) to host files, products, or servers in Amazon’s cloud.  At last month’s Mid-Michigan ColdFusion User’s Group meeting, there was a presentation from Rick Mason on Amazon S3.  S3, a storage system in the cloud is not something that really peaked my interest, but another related tool, EC2, did.

EC2 is a service where you can rent a VPS, or virtual server by the hour.  You literally pick a server ‘image’ or AMI, and tell it to boot.  Once you have your machine booted up, you can access it, login as root, and away you go.

However, in spite of all the great marketing, EC2 is a real bear to setup.

  • The tools take FOREVER to get setup correctly.  On Windows, you have to download the tools, install the Java SDK (if you don’t already have a current version), setup a bunch of DOS Environment Variables, generate and download your server certificate and private-key certificate, break your pk certificate into a private and public key set (if you want to use any tools other than Cygwin SSH client), and setup your SSH client. Providing a simple tool written for Win/Mac (using something like AIR) could drop this down to two steps.
  • Find an AMI that you wish to base your image off of.  Amazon offers about a dozen base installs — based on various OSs and software packages.  There are hundreds of other ‘public’ AMI images that have everything from Postgress SQL to SugarCRM pre-installed.  Amazon tags these images with an ‘AMI’ code.
  • Launch an instance (start your VPS) of that AMI based image using the following information: You are now paying by the hour
    • AMI Code
    • Your Private Key
    • Your Server Key
    • A group to launch the instance in (‘default’ by default)
  • Wait a few moments while the machine boots up, and then you must do an inquiry into which instances you are currently running. Write this instance ID down, as it is sometimes the only way to figure out what is running.  It should list back a public domain name, and a private domain name.  Write down which group it was launched in.
  • Open up the correct firewall ports so you can access your server.  Port 22 is for SSH.  There a bunch of features with the firewall, where you can even lock it down to your specific address on the net.
  • Connect using your client you setup in step-1.  Login is ‘ROOT’ for most AMI’s, and it will use your private/public key file as the password.
  • Download and install software.  The CentOS Amazon images don’t include many tools to download files — you can however use yum to install a text-based web browser (called lynx) to download things.  Installing them is no harder than any other VPS.  For example, ColdFusion, you download the .BIN file, chmod +x coldfusion_801.bin, and then ./coldfusion.  You may need to find out where your copy of Apache is installed before you do this.
  • Once you are done installing and setting up your software, you need to create your own AMI.  Since the instances don’t persist for anything besides a reboot (at this time). In the base installs of CentOS, they included the tools to do this via command line.  You will need to upload your Private Key, your Public Key (to the /mnt/ folder!), and get your Amazon Account Number (from the website).  Creating my AMI image that included ColdFusion and Flash Media Server took about 15 minutes.  Write down the location to the manifest.xml file that is created.
  • Next, you will want to send your new AMI images to somewhere.  AMI images stored on Amazon’s S3 service can be booted by just knowing the AMI code. You will need to setup a bucket to store the AMI in, and upload it to S3.
  • Register the AMI image so that is is bootable.  You will need a bunch of info again, and you will need the location to that manifest.xml document.

That’s it (I hope).  Most of this can and should be integrated into some easy-to-use tools.  Right now it is really an experience that Unix Admins love (everything is command line!), but the rest of the world will have a hard time with.

Side note: There is a tool out for Firefox which helps simplify some of these steps, however, because of the terminology that they use, you still need to be familiar with these steps to figure out what is going on.

Advertisements

10 responses to “Amazon’s EC2 and ColdFusion / FMS

  1. John D. May 17, 2008 at 1:51 pm

    Great post! Seeing all the steps laid out here makes it seem a lot harder than it was (at least for me). The Amazon screencast here was probably the most helpful thing I found when getting set up. Advice to others: after watching the video, do yourself a favor and get the Firefox EC2 plugin (it manages your keys, and eliminates a lot of the tedious command line work involved in launching and configuring instances).

  2. Pingback: links for 2008-06-02 « PaxoBlog

  3. Mehvish Naquvi June 24, 2008 at 10:01 pm

    Wow! It seems as if you had to go through so many steps, thanks for giving such a well detail post. I’m a marketing intern for GoGrid (http://www.GoGrid.com), and still in the process of learning the many aspects of the “Cloud.” We are a direct competitor to Amazon EC2 (http://blog.gogrid.com/2008/06/17/comparison-gogrid-cloud-versus-amazon-ec2/.) GoGrid can help you eliminate a lot of those “tedious commands” you said you were coming across while launching and configuring. GoGrid enables you to deploy and manage load balanced cloud server. We also offer various features such as free load balancing, free static IPs, full root/administrator access, etc. GoGrid supports a variety of Linux and Windows operating systems and provides server images with preinstalled software, such as mysql, IIS, Microsoft SQL Server and others. You can test to see for yourself. Just a quick note: the prices are always based on both RAM usage and Outbound transfer (inbound is always free though); with discount volume plans available as well.

    Thanks,
    Mehvish

  4. raulriera July 2, 2008 at 11:18 pm

    Whats the license implication on this? Do you have to pay a ColdFusion and Flash Media Server license for every instance of the server?

  5. quetwo July 3, 2008 at 12:10 am

    @raulriera

    Technically, you would need to purchase a license for each instance you plan on launching. Since my testing only required a few connections to FMS, I was able to go down that route (An unlicensed FMS works for up to 10 connections). Other products, such as Red-5 would put in much better senerios.

    The ColdFusion load was more of a proof of concept. It was working great, but I only had it installed for less than 30 days. If it would have been more than that, then I would have needed to purchase a license to get it out of Developer mode.

    @Mehvish. I appreciate the link. i will check you guys out soon too. I think the main reason why I wanted to try this on Amazon was to see what the buzz was about. Personally, I don’t have any real applications that require the need to scale (I have a VPS package at my host, plus a load of servers at work). I wanted to see what people were talking about, and what really made the thing tick 🙂

  6. raulriera July 3, 2008 at 12:44 pm

    So in theory it would be impossible to run ColdFusion on a EC2 system on “auto instance” where I would let Amazon decide to generate more instances of my server as it needs to so it will automactly scale and never “fail”?

  7. Matt March 13, 2009 at 9:22 am

    Very cool, but very long winded, i hope i don’t have the same problems when setting up Railo though!

  8. Jon October 13, 2009 at 6:22 pm

    I believe technically, ColdFusion is licensed per the number of physical CPUs on the physical hardware. This is why many companies who have virtual environments avoid ColdFusion. Putting coldfusion in Amazon’s EC2 service could open you up to a lot of legal liability if you don’t get explicit permission from Adobe first.

    • quetwo October 14, 2009 at 12:31 pm

      Luckily Adobe realizes this, and has changed their licensing model so that CF is allowed on the cloud. Rumor has it that there will be X number of instances that you will be allowed to spin up per enterprise license. More details to come…

  9. Danny February 28, 2012 at 12:58 am

    There are also two open source ColdFusion engines available: Railo and Open BlueDragon

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: