HOWTO: Deal with Amazon’s “requested Availability Zone is no longer supported” error

In shutting down the AdGrok servers (talk about bittersweet…), I stopped the instances, but then remembered I wanted to shred the files first, so I clicked “start,” and was greeted by the following error:

The requested Availability Zone is no longer supported. Please retry your request by not specifying an Availability Zone or choosing us-west-1b, us-west-1c.

Assuming your instance was backed by an EBS volume (and there wouldn’t be any valuable state for the instance otherwise, so that should be a reasonable assumption), you’ll need to migrate your EBS volume to a different availability zone, and start a new instance there.

To move an EBS volume from one availability zone to another, you need to:

  1. create a snapshot of the EBS volume
  2. use the snapshot to create a new EBS volume in the destination zone
  3. attach the new EBS volume to an instance in the destination zone

You can do all these tasks through the AWS Management Console, in the “ELASTIC BLOCK STORE” sections.

Run a RAID6 on Amazon EBS For Fun and Profit

With all this badmouthing Amazon’s Elastic Block Store, I wanted to share how we’ve set up our MySQL server for AdGrok.

Step 1: Create a bajillion tiny EBS volumes

We’ve got a bunch of performance data in MySQL, so our database is in the tens-of-gigabytes size. I didn’t want to worry about rebuilding the RAID, so I used the AWS console to build 8 15GiB volumes.

Why eight volumes? Because I wanted to use RAID6.

Continue reading

HOWTO: Force https with Amazon Elastic Load Balancer and Apache

The Amazon ELB service now supports https, which is great, but how do you configure Apache such that it redirects all insecure requests to use a secure connection?

It turns out that the ELB adds a X-Forwarded-Proto header that you can capture with a mod_rewrite rule. Here’s the configuration snippet:

<VirtualHost *:80>
  ...
  RewriteEngine On
  RewriteCond %{HTTP:X-Forwarded-Proto} !https
  RewriteRule !/status https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
</VirtualHost>

(this assumes your health check is /status, which doesn’t require https)