1. Installation Preparation
[Root@chen download]# tar zxvf mongodb-linux-x86_64-2.2.0.tgz
[Root@chen download]# CP Mongodb-linux-x86_64-2.2.0/usr/local/mongodb-r
2. Create database folders and log files
[Root@chen download]# Mkdir/usr/local/mongodb/data
[Root@chen download]# Touch/usr/local/mongodb/logs
Set up startup
Add MongoDB Startup items to rc.local guarantee MongoDB start when server is powered on
[Root@chen download]# echo "/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data–logpath=/usr/local/ Mongodb/logs–logappend--auth–port=27017 ">>/etc/rc.local
Start MongoDB
CD to the MongoDB directory in the Bin folder boot MongoDB
Here is the login method that requires permission, user name and password to connect
[Root@chen download]#/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--logpath=/usr/local/mongodb/ Logs--logappend--auth--port=27017--fork
This one doesn't need a password.
[Root@chen download]#/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--logpath=/usr/local/mongodb/ Logs--logappend--port=27017--fork