1,下载安装包
[root@localhost joeyon]# curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.4-rc0.tgz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 38.4M 100 38.4M 0 0 82735 0 0:08:06 0:08:06 --:--:-- 154k
2,解压安装包
[root@localhost joeyon]# tar -zxvf mongodb-linux-x86_64-3.0.4-rc0.tgz
mongodb-linux-x86_64-3.0.4-rc0/README
mongodb-linux-x86_64-3.0.4-rc0/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-3.0.4-rc0/GNU-AGPL-3.0
mongodb-linux-x86_64-3.0.4-rc0/bin/mongodump
mongodb-linux-x86_64-3.0.4-rc0/bin/mongorestore
mongodb-linux-x86_64-3.0.4-rc0/bin/mongoexport
mongodb-linux-x86_64-3.0.4-rc0/bin/mongoimport
mongodb-linux-x86_64-3.0.4-rc0/bin/mongostat
mongodb-linux-x86_64-3.0.4-rc0/bin/mongotop
mongodb-linux-x86_64-3.0.4-rc0/bin/bsondump
mongodb-linux-x86_64-3.0.4-rc0/bin/mongofiles
mongodb-linux-x86_64-3.0.4-rc0/bin/mongooplog
mongodb-linux-x86_64-3.0.4-rc0/bin/mongoperf
mongodb-linux-x86_64-3.0.4-rc0/bin/mongod
mongodb-linux-x86_64-3.0.4-rc0/bin/mongos
mongodb-linux-x86_64-3.0.4-rc0/bin/mongo
3,创建data目录和日志目录
[root@localhost bin]# mkdir -p /var/log/mongodb
[root@localhost bin]# mkdir -p /var/lib/mongo
4,设置环境变量
[root@localhost bin]# export PATH=/var/local/mongodb/mongodb-linux-x86_64-3.0.4-rc0/bin:$PATH
5,启动
[root@localhost bin]# mongod --dbpath=/var/lib/mongo --fork --logpath=/var/log/mongodb/mongod.log --master
about to fork child process, waiting until server is ready for connections.
forked process: 24450
child process started successfully, parent exiting