1.查看ubuntu版本,下载对应的mongodb版本,下载地址:https://www.mongodb.com/download-center
cat /etc/issuewget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-3.2.7.tgztar xvf mongodb-linux-x86_64-ubuntu1404-3.2.7.tgz
2.以配置文件启动,新建mongo.conf
vi mongo.conf内容如下:dbpath=/data/mongodb/datalogpath=/data/mongodb/log/mongodb.loglogappend=false#auth=truefork=true
3.启动mongodb
./mongod -f mongo.conf