0, Installation Environment Description:
Linux system: centos6.5
MongoDB version: Mongodb-linux-x86_64-rhel62-3.2.7.tgz
1. Download
MongoDB Download: https://www.mongodb.com/download-center#community, note select version
2. Decompression
TAR-ZXVF mongodb-linux-x86_64-rhel62-3.2.7.tgz
3. Specify the installation directory
MV Mongodb-linux-x86_64-rhel62-3.2.7/usr/local/mongodb
4. Create folders in the MongoDB folder data and logs
Cd/usr/local/mongodb
mkdir data
mkdir logs
5, create the configuration file mongodb.conf under Mongodb/bin, the file content is:
dbpath=/usr/local/mongodb/data #数据文件存放记录logpath=/usr/local/mongodb/logs/mongodb.log # Log file holds record port=27017Fork=true #以守护进程的方式运行nohttpinterface=true
6. Start the service
/usr/local/mongodb/bin/mongod--config/usr/local/mongodb/bin/mongodb.conf
7. Connection test
CD bin
./mongo
Db.help () lists the list of commands for MONGODB clients
8. View Logs
CD logs
Tail-f Mongodb.log
Installation of MongoDB (i)