centos6.8安装mongodb

wget  https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon-3.4.0.tgz


tar zxvf mongodb-linux-x86_64-amazon-3.4.0.tgz


mv mongodb-linux-x86_64-amazon-3.4.0 /usr/local/mongodb


cd /usr/local/mongodb

#创建data目录和logs目录

make -p data logs

#启动

vi mongodb.conf

port=27017

logpath=/usr/local/mongodb/logs/mongodb.log

logdbpath=/usr/local/mongodb/data/

logappend=true

fork=true


./mongod -f ../mongodb.conf


启动命令行界面

./mongo



访问成功

http://172.16.41.31:27017

It looks like you are trying to access MongoDB over HTTP on the native driver port.


以上转载

https://my.oschina.net/u/2607587/blog/779404


参考文档

http://howiefh.github.io/2014/04/26/mongodb-note-1-install-mongodb/

评论

© dzxlovelar | Powered by LOFTER