ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Anyone trying Amazon RDS?

October 27, 2009 3:13am

Subscribe [8]
  • #16 / Feb 12, 2010 3:49pm

    cmoschini

    2 posts

    My understanding of the process is this for EE:

    1. Swapping RDS addresses for the current mysql addresses in the EE config files.
    2. Picking an AMI to use.
    3. Customize it.
    4. Uploading the content to a persistent directory and then moving it to the server or doing a sym link to that directory.
    5. Getting an elastic IP from Amazon.
    6. Build and upload the new AMI
    7. After testing, switching DNS entries to point there.

    If anyone has additional tips (e.g. a good AMI to use, whether to use a persistent directory and sym link or what?) or steps that are missing etc, I would love to hear them.

    This is coming from an avid AWS user, but not Expression Engine (I run several sites on ASP.Net hosted on EC2).

    First of all, Amazon has made AWS ridiculously simple. All of the steps I’m about to describe involve clicking around in the web app at http://aws.amazon.com/console/, unless otherwise specified.

    Second, yes, signing up for this stuff and using it does cost money to mess with, but it’s pennies. Experimenting with it might cost you $5 at most, probably more like $2. It’s really cheap so just set it up.

    There are basically 3 pre-built AMIs for Windows provided for you by Amazon, making the selection process very simple. They have obvious differences of size and cost - use the instance named “Getting Started on Microsoft Windows Server 2008” if you’re not sure - launch it on a Small Instance.

    Once you’re signed in, get an Elastic IP (point and click - it will be obvious).

    Launch your AMI, and assign your Elastic IP to it. Begin installing the necessary software over Remote Desktop. While it installs, create an EBS volume, then Attach it to your Instance and name it /dev/sda2. Then go back to Remote Desktop and open Disk Manager. The EBS Volume appears as an unformatted drive - format it and give it a drive letter. You want to put your content on this second drive.

    At this point you might want to backup what you’ve done so far. Select your Instance in AWS and click Instance Actions > Create Image (EBS AMI). This will take your Instance offline for about 20 minutes while AWS freezes the instance and copies everything over to an AMI backup. Should your Instance ever fail in the future, you can launch it again from this AMI. Since it freezes your Instance, you want to do this infrequently - only after Configuration changes to your Windows instance.

    For changes besides Windows Configuration (content, app code, etc), those should all live on your second EBS Volume you attached. To back that up you select it and click Create Snapshot. The Snapshot is created without freezing anything, almost instantly. You’ll want to do these frequently (once a day, or once an hour, depending on your backup policy).

    There’s an additional detail of configuring both firewalls - the AWS firewall (“Security Group”) and the Windows Firewall to let in all the traffic you want (basically open port 80) - I can cover that later if anyone is curious.

    Launching an RDS instance is less simple - it doesn’t have an AWS Console option yet, so you need to use the command-line to launch an RDS instance:
    http://docs.amazonwebservices.com/AmazonRDS/latest/GettingStartedGuide/
    Like:

    rds-create-db-instance ee0
       --allocated-storage 20 --db-instance-class db.m1.xlarge --engine MySQL5.1 
       --master-username root --master-user-password root 
       --db-name EE --headers

    Obviously use a harder to guess user/pass than root/root.

    Follow the instructions in the above link to open up access to your EC2 Security Group, and probably your current IP for now, then get the name of it via the command-line - it will look something like:
    ee0.crwjauxgijdf.us-east-1.rds.amazonaws.com

    Then connecting to it is as simple as connecting to any MySQL server. Use whatever tools you normally use to interact with MySQL and enjoy.

    If at any time you need to shut all this down and want to come back to it later, just save off an AMI of the RDS and the EC2 instance and shut them down. You’ll be charged pennies (really, a few cents a month.. it’s next to nothing) to keep storing the AMIs until you come back to them, so don’t fret the cost of storing them between when you have time to explore.

  • #17 / Mar 14, 2010 3:16am

    lebisol's avatar

    lebisol

    2234 posts

    I can confirm that it works pretty nice on their AMI of:
    LAMP Web Starter = Fedora Core 8, 32-bit architecture, PHP 5.2, Apache 2.2, and MySQL 5
    and switching db is as much work as migrating from dev machine to live host.

    It would be very nice to see (*hint*hint* developers) if there was a module that can detect a busy mysql server (essentially ee template rending time) based of some threshold and switch to say EE ‘config2.php’ pointing to a db over to Amazon RDS 😊

  • #18 / Mar 14, 2010 9:36am

    ChrisR1776

    11 posts

    Regarding using a backup database if the main database is busy/down, I have mine set up so that if it can’t connect to the database at any point, it serves a static version of the page.  This is so that the primary purpose of the site can be accomplished without all the bells and whistles provided by EE.  It is actually only two places in the code where a change like you are talking about if I remember correctly.

    It would be easy to have it check for a secondary database prior to that though.  I’m not sure about doing it as a plug-in though as I have never done that.

    I was somewhat surprised the first time the database went down that the entire site went down without a graceful error message and had to remedy it immediately.

    BTW, I’m running it on AWS too and it works nicely - everything on one server at the moment though.

  • #19 / Jun 19, 2013 4:35am

    BrettDaren

    1 posts

    As technology expert and geek i have been using Amazon Relational Database Service (RDS). I can provide you lots of information regarding it . It is though bit more expensive but it is more powerful and separates your server from others and provide you more anonymity. So in a brief summary Amazon RDS basically guides your business and DevOps to manage and outsource their extensive & immense database to reengineer their data base. Although i recommend you to visit the following source to get a comprehensive view comprehensive view over amazon rds and make you more sound technically.

    Source: Cloudreviews(dot)com/blog/amazon-rds-for-businesses-and-devops

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases