1、下载mongodb,无需编译(如果https不行,可以换成http)
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.1.tgz
tar -zxvf mongodb-linux-x86_64-2.6.1.tgz
mv mongodb-linux-x86_64-2.6.1 mongodb2.6.1 //简化目录名
2、建立数据、日志文件目录
cd /yourrootdocument
mkdir mongodb_data
mkdir mongodb_logs
3、运行mongodb:
cd mongodb2.6.1/bin
./mongod --dbpath=/mongodbdata/mongodb_db --logpath=/mongodbdata/mongodb_logs/mongodb.log --logappend&
4、检查端口是否启动,默认端口为:27017
netstat -lanp | grep 27017
5、本地客户端测试
cd mongodb2.6.1/bin
./mongo
输出
MongoDB shell version: 2.6.1
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
ok,大功告成!
linux 安装 mongodb,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/pzrr/p/3790715.html