There are a lot of documents to install, you can refer to this article:
http://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/
2 questions you may encounter after installation.
1. Let Mongod run the command in the background to start MONGO Mongod has a parameter--fork can make MONGO run in the background, but you must also set the--logpath parameter to specify the path of the startup log file, because the log cannot be written to the console at this time. Example:
mongod --fork --logpath /var/log/mongod.log
The MongoDB daemon (mongod) have a command-line option to run the server in the background ...
--fork
This command-line option requires so also specify a file to log messages to (since it can does use the current Consol e). An example of the This command looks like:
mongod --fork --logpath /var/log/mongod.log
You could put the into An/etc/init.d/mongod bash script file. And then, with the service run at startup, create the Symbolic links (s## & k##) inside of/etc/rc#.d/. Here's a tutorial that explains this process in the more detail. Scroll the section titled "Init Script Activation". This also have the added benefit of being able to execute commands like ...
service mongod statusservice mongod startservice mongos stop
2. Error executing Mongod-fork-logpath/var/log/mongod.log
about to fork child process, waiting until server is ready for connections. forked process: 10293 child process started successfully, parent exiting
This is because the current user has insufficient permissions to the log directory/var/log
MongoDB Linux installation configuration background run