When you photograph people in colour you photograph their clothes. But when you photograph people in B&W, you photograph their souls.

Ted Grant

Install MongoDB for 32-bit Linux AMI

May 28th, 2014

After several attempts at installing MongoDB on an AWS basic t1.micro instance using the published method of adding the 10gen repository to yum failed I looked into performing a manual install. It turned out to be a lot easier than I thought. Despite my impressions that I was running a 64-bit machine using uname -a revealed I was actually suing 32-bit. This explained why my attempt to register the 64-bit repository failed but not why my attempt to register the 32-bit repository failed.

MongoDB installation instructions for AWS EC2

Download the Latest Release

In a system shell, download the latest release for 32-bit Linux, in my instance to my home/ec2-user directory.

curl -O http://downloads.mongodb.org/linux/mongodb-linux-i686-2.4.8.tgz

You may optionally specify any preferred version you wish to download, 2.4.8 is the most current at time of writing.

Extract the Files From the Archive

Extraction of the files is via the tar command.

tar -zxvf mongodb-linux-i686-2.4.8.tgz

Copy Extracted Files to Installation Directory

I didn’t want to put these files into any of the main bin folders as I wanted to be able to keep track of the non-package manager software somewhere it would be easy to update. I put mine in a bin directory I created in home/ec2-user/. This newly created directory appeared to be in the $PATH variable already.

mkdir -p bin/mongodb
cp -R -n mongodb-linux-i686-2.4.8/ mongodb

Explain the mkdir and cp commands

Configure PATH

In order to pick up the newly installed files I amended the line beginningPATH=$PATH:$HOME/bin and added the following at the end:

PATH=$PATH:$HOME/bin:$HOME/bin/mongodb/bin

I believe this solution will not only allow me to run MongoDB but as it has not been package managed I should just have to replace the contents of the mongodb folder with a newly extracted download and everything else will be in place

Categories:
MongoDB|Uncategorized|Web Design