Quick and Easy Install of Current Mongodb on Cloud 9

I tried doing it via following the tutorial for Ubuntu (on Mongodb’s website). It was a fail.

You can determine the version of Ubuntu that’s running using lsb_release -a  As of this article, it’s 14.04.

What works without a hitch is their tutorial for installing it via tarball, but, if you don’t know your way around the shell, I’ll give you some quick help here.

Blow by blow, this is all you need to do:

First, from your c9 terminal, that likely reads:
[YOUR-ACCOUNT]:~/workspace $
cd ~

curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.2.tgz

tar -zxvf mongodb-linux-x86_64-3.4.2.tgz

In Mongodb’s tutorial, they have you do a copy to an mongodb directory, but this isn’t necessary.

If you don’t already know. From your home directory,
enter the following
vim .bashrc
Note that you can use whatever editor you want. nano is available also.

At the very top, there should be three lines, each preceded by a ‘#’ character. Create a blank line under the third ‘#’ and enter the following:
export PATH=/home/ubuntu/mongodb-linux-x86_64-3.4.2/bin:$PATH
Follow this with:
and then
I found that the vim command, ZZ, didn’t work in my terminal. To finish off, cover your bases with
sudo source .bashrc

Now, if you try and run mongod, it will run only in your current terminal. You can’t background it by using ‘&’, as in, mongod &. It doesn’t work in c9. Instead, let’s move up the food chain a bit. We’ll detach the running mongo daemon with a background. Enter this
mongod & disown

The command will return you to your terminal. Now enter
And you’ll be ready to rock with a basic set-up.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s