Download the mongodb64-bit compressed file and put it on the CentOS system first.
1. install to/usr/local and create DB and logs directories
Tar zxvf mongodb-linux-x86_64-2.4.9.tgzmv mongodb-linux-x86_64-2.4.9 mongodbcd mongodbmkdir dbmkdir logs
2, add the configuration file, go to the bin directory, execute the command
CD Binvi mongodb.conf# copy and save the following content dbpath=/usr/local/mongodb/dblogpath=/usr/local/mongodb/logs/mongodb.logport= 27017fork=truenohttpinterface=true
3. rebind the configuration file address and access IP of MongoDB
/usr/local/mongodb/bin/mongod--bind_ip localhost-f/usr/local/mongodb/bin/mongodb.conf
4. Boot auto Start MongoDB
Vi/etc/rc.d/rc.local/usr/local/mongodb/bin/mongod--config/usr/local/mongodb/bin/mongodb.conf
5, restart the system test can be self-starting
#进入mongodb的shell模式/usr/local/mongodb/bin/mongo# View the list of databases show dbs# current DB version db.version ();
Getting Started with MongoDB, installing MongoDB in CentOS6.4