step1:download:https://www.mongodb.org/downloads
step2:tar -zxvf mongodb-linux-x86_64-3.2.4.tgz
step3:mkdir -p mongodbcp -R -n mongodb-linux-x86_64-3.2.4/ mongodb
step4
#you can add the following line to your shell’s rc file (e.g. ~/.bashrc):
vim ~/.bashrc
# mongodb config
#export PATH=<mongodb-install-directory>/bin:$PATH
>export PATH="/root/mongodb/mongodb-linux-x86_64-ubuntu1204-3.0.11/bin:$PATH"
step5
cd /root/mongodb/mongodb-linux-x86_64-ubuntu1204-3.0.11
mkdir data
mkdir log
step6
mongod --dbpath data --logpath log/mongod.log -logappend --fork
mongo
step7
echo "mongod --dbpath data --logpath log/mongod.log -logappend --fork">>start.sh
网友评论