Linux installation Start MongoDB

Source: Internet
Author: User

1: Download

Http://www.mongodb.org/downloads

Unzip the package after uploading it on the 85 machine.

first, unzip the installer in Linuxoperation by command:Decompression TAR-ZXVF mongodb-linux-x86_64-2.6.7.gzmongodb-linux-x86_64-2.6.7 renamed to MongoDB We put a new data directory in the MongoDB directory to hold the information, create a new log directory to hold the log, and then create a new log file under the directory, for example, we named Mongodb.logmkdir Log
mkdir data
CD Log
Touch Mongodb.log CD Mongodb/binUse the Mongod command to set up a MongoDB database link with a port number of 100001, a database path of/mongodb/data, and a log path of/mongodb/log/mongodb.logTouch mongodb.conf./bin/mongod-f mongodb.confMongoDB also provides a background daemon way to start, only need to add a "--fork" parameter, it is worth noting that the "--fork" parameter must be enabled "--logpath" parameter. As shown below:Shell Code

The fork parameter that the daemon mode starts can also be configured in the configuration file as follows:

Port=27017dbpath=data/dblogpath=log/mongodb.loglogappend=truefork=true

Then the configuration file starts after MongoDB is also started in the background:

Linux installation Start MongoDB

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.