1、下载并解压
weget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.13.tgz
tar zxvf mongodb-linux-x86_64-3.6.13.tgz
2、配置环境变量
vi /etc/profile
export PATH=$PATH:$FLUME_HOME/bin:$JAVA_HOME/bin:$MONGODB_HOME/bin
#mongodb
export MONGODB_HOME=/root/mongodb/mongodb
3、配置
mkdir {data,logs}
vi mongo.conf
dbpath=/root/mongodb/mongodb/data
logpath=/root/mongodb/mongodb/logs/mongo.log
logappend=true
journal=true
quiet=true
port=27017
fork=true
bind_ip=0.0.0.0
touch logs/mongo.log
4、启动服务
bin/mongod -f mongo.conf
5、进入shell
bin/mongo