wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-3.2.6.tgz
tar zxvf mongodb-linux-x86_64-3.2.6.tgz
mv mongodb-linux-x86_64-3.2.6.tgz mongodb
cd mongodb
mkdir db
mkdir logs
cd bin
[在bin目录下新建mongodb的配置文件mongodb.conf]
vi mongodb.conf
dbpath=/usr/local/mongodb/db
logpath=/usr/local/mongodb/logs/mongodb.log
port=27017
fork=true
重新绑定mongodb的配置文件地址和访问IP/usr/local/mongodb/bin/mongod –bind_ip localhost -f /usr/local/mongodb/bin/mongodb.conf
重启mongoDB
/usr/local/mongodb/bin/mongod –config /usr/local/mongodb/bin/mongodb.conf
测试是否成功
进入mongodb的shell模式/usr/local/mongodb/bin/mongo
#查看数据库列表
show dbs
#当前db版本
db.version();
3.2.6