0. 设置环境变量
echo "export PATH="$PATH:/home/tools/mongodb-linux-x86_64-rhel62-3.6.3/bin/"" >> /root/.bashrc
1. 创建目录
touch /etc/mongo/mongo.conf mkdir /data/mongodb/db/ -p mkdir /data/mongodb/log -p touch /data/mongodb/log/log
2. 配置
dbpath=/data/mongodb/db/ logpath=/data/mongodb/log/log logappend=true port=27017 fork=true
3. 启动
mongod -f /etc/mongo/mongo.conf
mongo 121.9.245.183/admin -u <username> -p