mongodb软件包下载 [root@localhost softs]# wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-1.8.5.tgz [root@localhost softs]# tar xf mongodb-linux-x86_64-1.8.5.tgz
[root@localhost softs]# ls
mongodb-linux-x86_64-1.8.5 nginx-1.4.7 pcre-8.33
mongodb-linux-x86_64-1.8.5.tgz nginx-1.4.7.tar.gz pcre-8.33.tar.gz
[root@localhost softs]# cd mongodb-linux-x86_64-1.8.5
[root@localhost mongodb-linux-x86_64-1.8.5]# ls
bin GNU-AGPL-3.0 README THIRD-PARTY-NOTICES
[root@localhost mongodb]# vi mongodb.conf ###conf配置文件需要手动创建 port=27017 #指定服务端口
dbpath=data/ #数据目录
logpath=log/mongodb.log ##日志存放目录
logappend=true
fork=true
[root@localhost mongodb]# mkdir data
[root@localhost mongodb]# mkdir log
[root@localhost mongodb]# ll
total 64
drwxr-xr-x. 2 root root 4096 Feb 1 2012 bin
drwxr-xr-x. 2 root root 4096 Apr 13 14:29 data
-rw-------. 1 root root 34520 Jan 22 2012 GNU-AGPL-3.0
drwxr-xr-x. 2 root root 4096 Apr 13 14:29 log
-rw-r--r--. 1 root root 80 Apr 13 14:28 mongodb.conf
-rw-------. 1 root root 731 Jan 22 2012 README
-rw-------. 1 root root 7866 Jan 22 2012 THIRD-PARTY-NOTICES
[root@localhost mongodb]# ./bin/mongod -f mongodb.conf
[root@localhost mongodb]# forked process: 37665
all output going to: /softs/mongodb/log/mongodb.log
[root@localhost mongodb]# ps -ef |grep mongodb
root 37665 1 0 14:31 ? 00:00:00 ./bin/mongod -f mongodb.conf
root 37834 35790 0 14:31 pts/0 00:00:00 grep mongodb
[root@localhost mongodb]# netstat -tunlp |grep :27017
tcp 0 0 0.0.0.0:27017 0.0.0.0:* LISTEN 37665/./bin/mongod
|