Decompress:
Decompress the compressed package and move the bin folder in the extracted folder to/usr/local/mongodb.
Create the directory mongodb/data/db and mongo/logs under home/tiantao /.
Create a file mongodb. log in logs
Use the root user to configure the/etc/rc. local file
Add/usr/local/mongodb/bin/mongod to the file -- dbpath/home/tiantao/mongodb/data/db -- logpath/home/tiantao/mongodb/logs/mongodb. log
Restart
Enter usr/local/mongodb/bin/mongo on the terminal
Test books can use databases
Use the command mv mongodb/usr/local
Create the data/db directory cd to the/home/tiantao/mongodb directory mkdir data
Cd data and then mkdir db
Create a logs directory cd to mongodb mkdir logs
Cd logs and then mkdir mongodb. log
Edit the/etc/rc. local file vi/etc/rc. local
Add/usr/local/mongodb/bin/mongod to the file -- dbpath/home/tiantao/mongodb/data/db -- logpath/home/tiantao/mongodb/logs/mongodb. log
Last reboot
Check whether/usr/local/mongodb/bin/mongo can access the database.
Check whether logs are written to/home/tiantao/mongodb/logs/mongodb. log.