Tuesday, November 16, 2010

Top o' the EC2 ya!

So, things have been a little quiet here lately. Most of the blame can be placed on TEDxRochester, of course. But, now that it's over, life is slowly starting to return to normal and I'm returning back to my projects. As you saw from my last post, I still continue playing around with Ubuntu, but aside from just my laptop getting my attention I've added a new Ubuntu project.

A few weeks ago, I learned that Amazon was opening up a free tier to their Amazon Web Services. Now, I haven't wrapped my whole head around the platform yet, but it really is an amazing suite of products and offerings the big "A" has put out there. In a nutshell, AWS is a virtual hosting service, commonly referred to as a cloud service.

AWS is made up of a couple of offerings, but the one I'm currently spending the most time on is the Amazon Elastic Compute Cloud (Amazon EC2), their virtual machine hosting service. I've actually got a virtual machine running Ubuntu Server out on their hardware. In fact, you're visiting it right now! Amazon, and other members of the AWS community, provide base images that can then be built on to establish your own presence on the web. As an example, this machine is built from AMI-00877069. This is a Canonical-provided Amazon machine image (AMI) of the Maverick Meerkat (10.10) version of Ubuntu Server. Simply select your AMI, launch your instance and you've got a machine in the cloud!

From there I added Apache, MySQL, Wordpress, etc. These machines are not accessible from the Internet immediately, though. They exist on a private 10.x.x.x subnet, but Amazon provides what they call their "Flexible IPs" which are nothing more than externally accessible IPs that you can then map to your "box". What's even nicer is Amazon provides you with a dead-simple firewall setup to decide how accessible your systems are. You can create groups to segment ("Web" group is accessible on port 80, but incoming mail servers on 25 only) and open up only what you need.

Since I'd already registered the domain, all I needed to do was modify the DNS at my registrar and I was on the web! In fact, if you want to visit my wife's site and get yourself a zombie portrait done, that too is hosted on this virtual box.

As mentioned, I haven't really dug too deeply into the full offering set, but as I find need I check it out. Most of the services are geared to the web developer/web applications crowd. For example, the SimpleDB service allows you to host your database at Amazon without having to worry about the details of administering a database server. Put your data in, pull it out as needed. Next on my list to work with is S3, their cloud storage solution. There's apparently a bug in their console that makes it inaccessible to browsers using the newest Flash, and so I haven't fiddled much with it.

So, aside from giving me yet another toy to play with, what's the market for Amazon Web Services? The answer: the sky's the limit. I first became aware of EC2, for example, when checking out web hosts for the domains my wife and I needed. A number of the more inexpensive hosts proudly boast that they're hosted at Amazon. Quite a few of the newer "Web 2.0" (are we still using that term?) services also are hosted here. Think about it: you want to run a web host or a web-based application, but you don't want the hassle of a server farm. With Amazon Web Services, you simply fire off instances as needed and manage your entire infrastructure from your living room in your PJs.

You also can provide your customers with a level of scalability that's difficult for even the most experienced admins to provide (said as an admin who's had to provide those levels of scalability!) You can, for example, start with a single instance to handle traffic. As traffic expands, you can configure AWS to fire off new instances of your hosts to handle the load. As the load decreases, the instances are shut down. How cool is that?

I've spent some time in my career working with VMware and Citrix XenServer farms, and Amazon Web Services is that to the next level. In the IT world, virtualization's the big buzz now as you can provide your end users with scalability and availability that was never before possible. Amazon's made it easy for anyone to tap into that power with nothing more than a web browser. But, beyond all of that, the services are CHEAP! A "small" instance, which is a VM with 1.7G of memory will run you about 8.5 cents/hour. That's about $60/month. You can barely lease a physical server for that much, and when you add in costs for electricity and maintenance, Amazon Web Services is a steal.

As I mentioned, I'm taking advantage of the free tier that's being offered right now. New AWS customers can get on this tier for 12 months. This includes:

- 750 hours of Amazon EC2 Linux Micro Instance usage (613 MB of memory and 32-bit and 64-bit platform support) – enough hours to run continuously each month

- 750 hours of an Elastic Load Balancer plus 15 GB data processing

- 10 GB of Amazon Elastic Block Storage, plus 1 million I/Os, 1 GB of snapshot storage, 10,000 snapshot Get Requests and 1,000 snapshot Put Requests

- 5 GB of Amazon S3 storage, 20,000 Get Requests, and 2,000 Put Requests

- 30 GB per of internet data transfer (15 GB of data transfer “in” and 15 GB of data transfer “out” across all services except Amazon CloudFront)

- 25 Amazon SimpleDB Machine Hours and 1 GB of Storage

- 100,000 Requests of Amazon Simple Queue Service

- 100,000 Requests, 100,000 HTTP notifications and 1,000 email notifications for Amazon Simple Notification Service

Now, even if you're a seasoned IT pro you're probably wondering what some of those things mean. The reality is, Amazon has come up with their own phrasing and terms for some things, so you really have to dig in yourself to see. For me, though, having that free virtual machine is more than enough reason to give it a try! Keep in mind, though, it's free for a year. After that, it's 2 cents/hour to run your box. Oh, my, 2 cents/hour! That's $15/month! Told you...holy crap this is a cheap service!

Now, if you're going to sign up, learn from one of my big mistakes: don't just grab an AMI to launch. There are two types of instances you can use, a standard EC2 one and one that's EBS-backed (Elastic Block Storage, part of the Amazon S3 services). Non-EBS instances are temporary only. If you shut the machine down, even to reboot, it goes away permanently. It's designed for scenarios like I mentioned above: firing up new, temporary instances for handling load. Is there anything more fun than rebooting to install updates only to have all of the work you've done vanish into the ether? Yeah, pay attention to your AMI types, people!

When you choose to launch your first instance, select the "Community AMIs" tab and select "EBS Images" in the dropdown and go from there. If you're going to try out Ubuntu, stick with the official Canonical-provided images. These all come from user 099720109477, so you can just search for them. You need to remember to add an Elastic IP to it and at least open up port 22 so you can SSH in later, but beyond that...you're done (assuming you remember to make it a Tiny instance). Build your box and go. Don't want to be limited to Server? No reason you can't build a full desktop accessible everywhere. :)

You also have options to run Windows boxes, but you cannot get them in a Tiny instance, so they're not free. But, it's doable! As I learn more about the services and offerings, I'll be posting my findings and learnings. I've also learned tons about managing Apache, MySQL and Wordpress that I'm looking to share, too. For now, give it a try! It's FREE!!

5 comments:

  1. [...] This post was mentioned on Twitter by Jeff Barr, Tony Karakashian. Tony Karakashian said: Latest blog entry: Top o’ the EC2 ya! http://ping.fm/A5au8 [...]

    ReplyDelete
  2. Welcome to the clouds! :-)

    As a minor, note that the EC2 machines do have individual public IPs assigned to them on launch, so you don't necessarily have to map an Elastic IP to the box unless you really want a stable IP for your account. You can get the public IP next to the private one through the API (e.g. ec2-describe-instances) or the web console.

    ReplyDelete
  3. Very well written. Will need to read a couple of more time to get all of the info out but I have some ideas already.

    Thanks

    ReplyDelete
  4. Gustavo: good info, thanks! I'll take a look at that.

    ReplyDelete
  5. Glad to be of service, Mr. F!

    ReplyDelete