Database Reference
In-Depth Information
A.1.4
Compiling MongoDB from source
Compiling MongoDB from source is recommended only for advanced users and
developers. If all you want to do is operate on the bleeding edge, without having to
compile, you can always download the nightly binaries for the latest revisions from the
mongodb.org website.
That said, you may want to compile yourself. The trickiest part about compiling
MongoDB is managing the various dependencies. These include Boost, Spider-
Monkey, and PCRE . The latest compilation instructions for each platform can be
found at http://www.mongodb.org/display/ DOCS /Building .
A.1.5
Troubleshooting
MongoDB is easy to install, but users occasionally experience minor problems. These
usually manifest as error messages generated when trying to start the mongod daemon.
Here I provide a list of the most common of these errors along with their resolutions.
W RONG ARCHITECTURE
If you try to run a binary compiled for a 64-bit system on a 32-bit machine, you'll see
an error like the following:
-bash: ./mongod: cannot execute binary file
On Windows 7, the message is more helpful:
This version of
C:\Users\kyle\Downloads\mongodb-win32-x86_64-1.7.4\bin\mongod.exe
is not compatible with the version of Windows you're running.
Check your computer's system information to see whether you need
a x86 (32-bit) or x64 (64-bit) version of the program, and then
contact the software publisher.
The solution in both cases is to download and then run the 32-bit binary instead. Bina-
ries for both architectures are available on the MongoDB download site ( http://
www.mongodb.org/downloads ).
N ONEXISTENT DATA DIRECTORY
MongoDB requires a directory for storing its data files. If the directory doesn't exist,
you'll see an error like the following:
dbpath (/data/db/) does not exist, terminating
The solution is to create this directory. To see how, consult the preceding instructions
for your operating system.
L ACK OF PERMISSIONS
If you're running on a Unix variant, you'll need to make sure that the user running
the mongod executable has permissions to write to the data directory. Otherwise, you'll
see this error
Permission denied: "/data/db/mongod.lock", terminating
 
Search WWH ::




Custom Search