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