Skip to content

Instantly share code, notes, and snippets.

@shawnburke
Created October 6, 2012 01:32
Show Gist options
  • Select an option

  • Save shawnburke/3843385 to your computer and use it in GitHub Desktop.

Select an option

Save shawnburke/3843385 to your computer and use it in GitHub Desktop.
Setting up MongoDB on an EC2 Instance
MONGO_BASE=~/mongodb/
MONGO_DB=~/mongodb/db
MONGO_DUMP=~/mongodb/dump
MONGO_INSTALL=~/mongodb/bin
MONGO_VERSION=2.2.0
mkdir -p $MONGO_BASE
mkdir -p $MONGO_DB
mkdir -p $MONGO_DUMP
cd $MONGO_BASE
echo Downloading mongodb $MONGO_VERSION
T=mongodb-linux-x86_64-$MONGO_VERSION
curl -O http://fastdl.mongodb.org/linux/$T.tgz
echo Unpacking...
tar -xzf $T.tgz
rm $T.tgz
mkdir -p $MONGO_INSTALL
mv $T/bin/* $MONGO_INSTALL
rm -r $MONGO_BASE/$T
echo Mongo install complete.
@msaffitz
Copy link

msaffitz commented Oct 6, 2012

The MongoDB AMIs from 10gen make this really easy... https://aws.amazon.com/marketplace/pp/B0087GMEQ2/ref=srh_res_product_title Plus they hook into the 10Gen rpm repositories for easy updates. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment