1. wget https://fastdl.mongodb.org/linux/mongodb-linux-i686-2.6.7.tgz?_ga=1.68265944.858401362.1421216907//download
- TAR-ZXVF mongodb-linux-i686-2.6.7.tgz\?_ga\=1.68265944.858401362.1421216907//Decompression
- MV mongodb-linux-i686-2.6.7 MongoDB//rename
- RM mongodb-linux-i686-2.6.7.tgz\?_ga\=1.68265944.858401362.1421216907//Delete compressed package
- Mkdir-p/data/mongo/logs//create log directory
- Mkdir-p/data/mongo/db//Create DB directory
- CD mongodb/
- CD bin/
- VI mongodb.conf//Create Profile 10 is profile information
- DBPath =/data/mongo/db #数据文件存放目录
LogPath =/data/mongo/logs/mongodb.log #日志文件存放目录
Port = 27017 #端口
Fork = True #以守护程序的方式启用, which runs in the background
Nohttpinterface = True
Auth=true #需要验证
- CP mongodb.conf/etc/mongodb.conf//Put the configuration file in the ETC directory
- RM mongodb.conf//Delete conf under MongoDB file
- sudo ln-s/home/zhangxd/work/mongodb/mongodb/bin/mongod/usr/bin/mongod//Create a soft link
- Ln-s/home/zhangxd/work/mongodb/mongodb/bin/mongo/usr/bin/mongo//Create a soft link
- sudo yum install glibc.i686//compatible with an error, Forget what is wrong, if mongod-f/etc/mongodb.conf Start no error without execution
- Yum whatprovides libstdc++.so.6//compatible with a wrong, forget what's wrong, If mongod-f/etc/mongodb.conf start without error, do not
- sudo yum install libstdc++-4.4.7-16.el6.i686//compatible with one wrong, forget what's wrong if Mongod-f/etc/mongodb.conf boot no error no execution
- Mongod-f/etc/mongodb.conf//Use our configuration file to start Mon Godb
- Vi/etc/rc.d/rc.local add self-starter mongod-f/etc/mongodb.conf//Add boot-up
- Db.adduser (' Tank1 ', ' test '); Add the user, to which db to add to which db
CentOS MONGO Database Setup