linux 下安装mongodb
# uname -aLinux sc-wjg 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 18:37:12 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/redhat-release
CentOS> #groupadd mongo
# useradd -g mongo mongo
#mkdir -p /database/mongodb/data/
# chown -R mongo:mongo /database/mongodb/data/
# mkdir -p /var/applog/mongo_log/
# chown -R mongo:mongo /var/applog/mongo_log/
#
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.2.7.tgz
# tar zxf mongodb-linux-x86_64-2.2.7.tgz
# mv mongodb-linux-x86_64-2.2.7 /usr/local/mongodb
# cd /usr/local/mongodb/
# ll
total 64
drwxr-xr-x 2 root root4096 Apr7 16:00 bin
-rw------- 1500500 34520 Jan 112013 GNU-AGPL-3.0
-rw------- 15005001359 Jan 112013 README
-rw------- 1500500 16787 Jan 112013 THIRD-PARTY-NOTICES
# mkdir /var/mongodb/data -p
# mkdir /var/mongodb/logs -p
# /etc/init.d/iptables stop
启动mongodb
# /usr/local/mongodb/bin/mongod --dbpath=/var/mongodb/data --logpath /var/mongodb/logs/log.log -fork
forked process: 29117
all output going to: /var/mongodb/logs/log.log
child process started successfully, parent exiting
登入
# /usr/local/mongodb/bin/mongo
MongoDB shell version: 2.2.7
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
> show dbs
页:
[1]