Installation of the Linux MongoDB database

Source: Internet
Author: User
Tags install mongodb

Toss two days, the former leader left the mess, the day before yesterday suddenly hung up, the whole company I will Linux, Grandma's, Long story.

Below is a record of how to install MongoDB, the front is copied from the Novice tutorial

1. Download
 - -bit installation package, you can download the installation package on the official website. : https://www.mongodb.com/download-center#community
2. Unzip the installation
Curl-o https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz    # download tar-zxvf mongodb-linux-x86_64-3.0. 6 . tgz                                   # Unzip the MV  MongoDB-linux-x86_64-3.0.  6//usr/local/mongodb  
3. Environment variables
MongoDB's executable file is located in the bin directory, so you can add it to your path path:

<mongodb-install-directory> for your MongoDB installation path. As the /usr/local/mongodb of this article

4. Start
On the command line, run the MongoDB service and you can execute the mongod command to start the MONGDB service by executing the bin directory in the MONGO installation directory.
$ ./Mongod -- the-25t16: the:50.549+0800I JOURNAL [Initandlisten] JOURNAL dir=/data/db/Journal -- the-25t16: the:50.550+0800I JOURNAL [initandlisten] recover:no JOURNAL files present, no recovery needed -- the-25t16: the:50.869+0800I JOURNAL [Initandlisten] preallocateisfaster=true 3.16 -- the-25t16: the:51.206+0800I JOURNAL [Initandlisten] preallocateisfaster=true 3.52 -- the-25t16: the:52.775+0800I JOURNAL [Initandlisten] preallocateisfaster=true 7.7

5. Background boot

1. configuration file/etc/mongod.conf

systemLog:destination:file Path:"/var/log/mongodb/mongod.log"Logappend:trueStorage://Journal://enabled:trueDbPath:"/data1/mongodb"Directoryperdb:trueEngine:wiredtiger WiredTiger:engineConfig:cacheSizeGB:6directoryforindexes:truecollectionConfig:blockCompressor:zlib indexconfig:prefixcompression:trueNet:port:27017processmanagement:fork:true//Replication://oplogsizemb:10000//Replsetname:zmongocluster

2. Start

/app/software/mongo/bin/mongod-f/app/software/mongo/bin/mongo.cnf--fork--logpath=/usr/local/mongodb/logs/ Mongodb2.log

If you need any parameters you can./mongod--help Reference

6. End Process
Lsof-i:5001'{print $}'1d' | Xargs Kill-9

Installation of the Linux MongoDB database

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.