mongodb安装启动方式如下:
cd /usr
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.3.tgz
tar -zxvf mongodb-linux-x86_64-3.4.3.tgz
mkdir /data/db
cd /usr/mongodb-linux-x86_64-3.4.3/bin
./mongod --fork --logpath=/var/log/mongodb.log
/data/db为数据存放路径,/mongod –fork –logpath=/var/log/mongodb.log以守护者进程方式启动mongodb,避免退出shell时mongodb关闭。
正确启动输出
about to fork child process, waiting until server is ready for connections.
forked process: 30049
child process started successfully, parent exiting