SUSE 11 安装MongoDB
SUSE 11 安装MongoDB(安装到/usr/local) ,安装包可以到http://www.mongodb.org 下载
具体执行方式如下
[root@localhost /]# cd usr/local/
[root@localhost /]# groupadd mongodb
[root@localhost /]# useradd mongodb -g mongodb
[root@localhost /]# cd /usr/local
[root@localhost local]# tar -zxv -f mongodb-linux-x86_64-2.2.2.tgz
[root@localhost local]# mv mongodb-linux-x86_64-2.2.2 mongodb
[root@localhost local]# chown -R mongodb: mongodb mongodb
[root@localhost local]# cd mongodb
[root@localhost mongodb]# mkdir /var/mongodb
[root@localhost mongodb]# mkdir /var/mongodb/data
[root@localhost mongodb]# mkdir /var/mongodb/logs
[root@localhost mongodb]# cd /mongodb/bin
然后在该目录下新建一个mongodb.conf
vi mongodb.conf
dbpath=/var/mongodb/data
logpath=/var/mongodb/logs/mongodb.log
port=9007
auth=true
fork=true
nohttpinterface=true
启动mongodb
/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/bin/mongodb.conf
登录mongodb
/usr/local/mongodb/bin/mongo -port 9007