Installing MongoDB

MongoDB installers are a bunch of binaries and libraries packaged in an archive. All you need to do is download and extract the archive. Could this be any simpler?

On Mac OS, you have two popular package managers Homebrew and MacPorts. If you are using Homebrew, just issue the following command:

$ brew install MongoDB

If you don't have brew installed, it is strongly recommended to install it. But don't fret. Here is the manual way to install MongoDB on any Linux, Mac OS, or Windows machine:

  1. Download MongoDB from http://www.mongodb.org/downloads.
  2. Extract the .tgz file to a folder (preferably which is in your system path).

It's done!

On any Linux Shell, you can issue the following commands to download and install. Be sure to append the /path/to/MongoDB/bin to your $PATH variable:

$ cd /usr/local/
$ curl http://fastdl.mongodb.org/linux/mongodb-linux-i686-2.0.2.tgz > mongo.tgz
$ tar xf mongo.tgz
$ ln –s mongodb-linux-i686-2.0.2 MongoDB

For Windows, you can simply download the ZIP file and extract it in a folder. Ensure that you update the</path/to/MongoDB/bin> in your system path.

Tip

MongoDB v1.6, v1.8, and v2.x are considerably different. Be sure to install the latest version. Over the course of writing this book, v2.0 was released and the latest version is v2.0.2. It is that version that this book will reference.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.255.126