《OD大数据实战》MongoDB环境搭建

一、MongonDB环境搭建

1. 下载

https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz

2. 解压

tar -zxvf mongodb-linux-x86_64-3.0.6.tgz -C /opt/modules

3. 创建目录

mkdir -p /opt/modules/mongodb-linux-x86_64-3.0.6/data/db

4. 启动

bin/mongod --dbpath /opt/modules/mongodb-linux-x86_64-3.0.6/data/db --rest

后台启动

nohup bin/mongod --dbpath /opt/modules/mongodb-linux-x86_64-3.0.6/data/db --rest >~/mongodb-start.log 2>&1 &

nohup bin/mongod --config bin/mongodb.conf >~/mongodb-start.log 2>&1 &

5. 参考博客

1) NoSQL之【MongoDB】学习(一):安装说明

4) http://www.runoob.com/mongodb/mongodb-tutorial.html

二、Shell命令

原文地址:https://www.cnblogs.com/yeahwell/p/5784158.html