Database Reference
In-Depth Information
That's all there is to it. At this point, MongoDB has been installed and is (almost)
ready to use!
running apt-get update on a system running an older version of MongoDB
will upgrade the software to the latest stable version available. You can prevent this from
happening by running this command:
echo "mongodb-org hold" | sudo dpkg --set-selections
Note
Installing MongoDB Manually
Next, we'll cover how to install MongoDB manually. Given how easy it is to install
MongoDB with aptitude automatically, you might wonder why you would want to
install the software manually. For starters, not all Linux distributions use apt-get.
Sure, many of them do (including primarily the ones that are based on Debian
Linux), but some don't. Also, the packaging remains a work in progress , so it might
be the case that there are versions not yet available through the repositories. It's also
possible that the version of MongoDB you want to use isn't included in the repository.
Installing the software manually also gives you the ability to run multiple versions of
MongoDB at the same time.
You've decided which version of MongoDB you would like to use, and you've
downloaded it from their website, http://mongodb.org/downloads , to your Home
directory. Next, you need to extract the package with the following command:
$ tar xzf mongodb-linux-x86_64-latest.tgz
This command extracts the entire contents of the package to a new directory
called mongodb-linux-x86_64-xxxx-yy-zz ; this directory is located under your current
directory. This directory will contain a number of subdirectories and files. The directory
that contains the executable files is called the bin directory. We will cover which
applications perform which tasks shortly.
However, you don't need to do anything further to install the application. Indeed,
it doesn't take much more time to install MongoDB manually—depending on what else
you need to install, it might even be faster. Manually installing MongoDB does have some
downsides, however. For example, the executables that you just extracted and found in
the bin directory can't be executed from anywhere except the bin directory by default.
Thus, if you want to run the mongod service, you will need to do so directly from the
aforementioned bin directory. This downside highlights one of the benefits of installing
MongoDB through repositories.
 
 
Search WWH ::




Custom Search