Category Archives: DevOps

The Engine Yard and Rails Survival Guide

Here are some hard lessons I’ve learned maintaining a Rails app on EngineYard. It’s an extremely reliable product with great support, but there are a few nuances. I’d love to save you time by telling you these up-front. I’ll update this over time.

First of all –

  • Do you host your app on GitHub? If so, link your GitHub account to EngineYard for breezy deploys. When we want to deploy, we click Deploy right from the EngineYard dashboard and it pulls our latest master from GitHub.
  • Hop onto your repositories by SSH on your computer, just to get that initial configuration out of the way. Use the “automated SSH link” discussed in the link.
  • Learn how to access the Rails console from SSH
  • Install the Engine Yard CLI.  You’ll need it to deal with some failed deploys.
    • Type gem install engineyard into the terminal if you’re on a Mac

Dealing with a failed deploy

  • Look at the log file.  If you’re lucky, you’ll see a message containing the word “relax.” This means that the deploy failed early enough to not affect your application.  Find the issue in the log and solve it.
  • If your application has the Engine Yard maintenance page up and it won’t away, use the CLI to get out of maintenance mode.
    • Type ey web enable into the terminal if you’re on a Mac

Learn how to clone your environment

We’re going to set up a staging server for Cook Smarts, and I’ll post about that. In the mean time, read over the cloning guide.  A couple of gotchas:

  • You may need to request an additional IP address if you don’t have any available, which you can do by clicking the + button near a region on this page
  • Remember to snapshot your environment right before you clone it. The clone takes your app and data from the latest snapshot.
  • Reasons to clone: you need a staging environment, or you need to test something quickly before you put it online.

Consider a staging environment, maybe

Do you need a separate staging server? Decide whether you want to keep it running all the time or just when you need to test new functionality. Choose a cheaper configuration for your staging server, particularly if you keep it running.

At Cook Smarts, we keep a separate staging environment but only have it on when we need it. This saves a significant amount of money.

Know what to do if you get this scary e-mail

We have received the following notification from Amazon that one or more of your Engine Yard Cloud instances may be affected by a maintenance period

Ack! What? These are rare but scary messages. They link to these horrifically named Replace Degraded Instances help page.

My only advice on this: clone your environment, and then test everything you are going to do to your production environment on the clone. This saved us.

More to come as we learn more…