Download MongoDB
wget http://downloads.mongodb.org/linux/mongodb-linux-i686-2.4.9.tgz
If the above address is not possible to go to the official website download Http://www.mongodb.org/downloads decompression MongoDB
Tar zxvfmongodb-linux-i686-2.4.9.tgz
Create the specified folder and copy the MongoDB past
Mkdir-p/usr/local/mongodb
cp-rmongodb-linux-i686-2.4.9/*/usr/local/mongodb/
Create database storage directory and log storage files
Mkdir-p/data/mongo/data
Touch/data/monogo/dblogs
Start Mongod
/usr/local/mongodb/bin/mongod--dbpath=/data/mongo/data--logpath=/data/mongo/dblogs --logappend --fork
//--fork is designed to allow programs to execute backstage
Set up startup
Echo/usr/local/mongodb/bin/mongod--dbpath=/data/mongo/data--logpath=/data/mongo/dblogs--logappend--fork > >/etc/rc.local
To close the Mongod process: Pkill mongod
Start command parameter description:
--dbpath Specify the directory where the database files are stored
--PORT Specifies the port used by the Mongod service default 27017
--fork set the MONGO service to run in the background
--LOGPATH Specifies the directory and file name of the log file
--logappend set each log to add at the end of the file
--journal Enable logging
--PIDFILEPATH specifies the path to the process file, and if not specified, the system will not produce a process
--maxconns Maximum concurrent connection number
--noprealloc to turn off the pre-allocation of data files
--rest Turn off REST API functionality
--nohttpinterface Turn off web management features
--AUTH Specifies that MONGO use the authentication mechanism--BIND_IP bind IP