二进制包下载地址:https://www.mongodb.org/dl/linux
tar xf mongodb-linux-x86_64-3.0.5.tgz -C/usr/local/
mv /usr/local/mongodb-linux-x86_64-3.0.5 /usr/local/mongodb
mkdir /usr/local/mongodb/data
touch /usr/local/mongodb/logs
groupadd mongodb
useradd -g mongodb mongodb -s/sbin/nologin -M
chown -R mongodb:mongodb /usr/local/mongodb
ll /usr/local/mongodb/bin
vim /etc/profile
mongod --dbpath=/usr/local/mongodb/data--fork --logpath=/usr/local/mongodb/logs
[root@client01 soft]# mongo
MongoDB shell version: 3.0.5
connecting to: test
默认数据库是test
本文转自 wjw555 51CTO博客,原文链接:http://blog.51cto.com/wujianwei/1957840