linux下安装mongodb
[root@sc-wjg ~]# uname -a
Linux 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
[root@sc-wjg ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)
创新互联长期为数千家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为镇原企业提供专业的做网站、成都网站建设,镇原网站改版等技术服务。拥有十年丰富建站经验和众多成功案例,为您定制开发。
[root@sc-wjg ~]# groupadd mongo
[root@sc-wjg ~]# useradd -g mongo mongo
[root@sc-wjg ~]# mkdir -p /database/MongoDB/data/
[root@sc-wjg ~]# chown -R mongo:mongo /database/mongodb/data/
[root@sc-wjg ~]# mkdir -p /var/applog/mongo_log/
[root@sc-wjg ~]# chown -R mongo:mongo /var/applog/mongo_log/
[root@sc-wjg ~]#
wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.2.7.tgz
[root@sc-wjg ~]# tar zxf mongodb-linux-x86_64-2.2.7.tgz
[root@sc-wjg ~]# mv mongodb-linux-x86_64-2.2.7 /usr/local/mongodb
[root@sc-wjg ~]# cd /usr/local/mongodb/
[root@sc-wjg mongodb]# ll
total 64
drwxr-xr-x 2 root root 4096 Apr 7 16:00 bin
-rw------- 1 500 500 34520 Jan 11 2013 GNU-AGPL-3.0
-rw------- 1 500 500 1359 Jan 11 2013 README
-rw------- 1 500 500 16787 Jan 11 2013 THIRD-PARTY-NOTICES
[root@sc-wjg mongodb]# mkdir /var/mongodb/data -p
[root@sc-wjg mongodb]# mkdir /var/mongodb/logs -p
[root@sc-wjg mongodb]# /etc/init.d/iptables stop
启动mongodb
[root@sc-wjg 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
登入
[root@sc-wjg mongodb]# /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
网站名称:linux下安装mongodb
网页地址:http://scyanting.com/article/jopgpi.html