|Table of Contents|
What is MongoDB?
MongoDB is a free and open-source big-data document database that stores data in flexible, JSON-like documents. Opmantek chose MongoDB as our back-end database because it is fast and reliable, all with relatively low overhead.
As of September 2015 the installation instructions below are no longer applicable; the installer will take care of installation and initial configuration of MongoDB for you.
Debian 7.0 (aka Wheezy) ships with a much older version, which should work but very likely won't provide adequate performance. However, the mongodb packages in wheezy-backports are fine, as are the versions in Testing/Jessie and Unstable. First make sure that you have Backports or Testing/Unstable enabled, then use
As an alternative you can also download Debian-ready packages from the MongoDB site, which do however use a different package name.
Recent versions of Ubuntu come with suitable MongoDB packages. Use
Installing the mongodb-server package will result in a working, automatically started MongoDB with no authentication.
Download MongoDB from the Website at https://www.mongodb.org/downloads.
Opmantek Setup for MongoDB
For Debian-derived distributions the default configuration is fine, but you might still want to adjust the database storage area. The configuration file is
For other systems, check that the location in the provided init script is where you want the database to store its files (the default is mongodbpath=/var/mongodb for the original version):
NOTE - this file will only exist AFTER you have run an installer which requires mongodb.
After you have the location you prefer, the next set of commands will put a start-up script in the correct location, register the script and then start mongo (before doing this make sure to consider how much data you plan to store. Each application has different needs and how you plan to use the application will have an enormous impact on the space required by the database). The last command here starts MongoDB, the first time it runs it can take some time to do its pre-allocation of database and journal files. This will depend on the performance of your storage.
If this is a Debian-derived system and you made config changes, then your mongod will already be running and you need to restart it like this:
Manual MongoDB Authentication Configuration
Please note that these instructions are applicable only for MongoDB 2.4 and as such are of historic interest only.
Should using the
Load the mongo CLI, create the user for the admin DB, authenticate, then do the same for the NMIS db (change the username and password to your liking):
NB: Now make sure that the user/pass matches the config in opCommon.nmis.
If you don't require authentication simply skip the steps above and set the username in the configuration file to ''