MongoDB Linux installation configuration background run

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.