Amazon’s S3 is a great, cheap way to host your static site. But if you’re moving over an old site, especially if you’re importing a site from a content management system, you might want or need to change your URL scheme. While it’s not as easy to find in the S3 documentation, it’s actually quite easy. Let’s start simple. Say we have a site that has a number of articles that were posted as www.domain.com/posts/this-is-the-slug.
There are two ways to go about backing up a MongoDB database - either taking a snapshot of the underling filesystem or taking a binary dump of the database. For various reasons we needed to go the binary dump route. We use AWS so the logical place to store the dump was in a dedicated S3 bucket. But how to get it there easily? I’ve used S3fuse in the past and that seemed like a decent option.
We’re using and EBS-backed RAID10 array for MongoDB. This is the only way to get reliable iops on AWS at the moment. Start by creating the volumes. For this example I’ll be creating 5 volumes of 10GB each. EBS volumes can only be attached to instances in the same region and AZ as the volume. Once the volumes are created attach them to the instance. I’ll be using /dev/sd[i-m], though the sd is the only important part.
Edit (2013/08/07): Debian now has an official account on the Amazon Marketplace and has Squeeze and Wheezy AMIs available. I haven’t used them yet, but will try them out for my next project. Recently I needed to create a “custom” AMI based on an existing Debian AMI. Debian links to some semi-official AMIs on their wiki- images created by RightScale and tom @ punch.net. I’ve been using the punch.net Squeeze EBS versions for a few weeks and been happy with them.