CentOS 6.5 安装 MongoDB

下载 mongodb-linux-x86_64-3.2.8.tgz

tar -zxv -f mongodb-linux-x86_64-3.2.8.tgz

mv mongodb-linux-x86_64-3.2.8 /usr/local/mongodb

 

Cd in /usr/local/mongodb/

Touch mongodb.conf

Touch log/mongo.log

Chmod 777 mongo.conf

Chmod 777 log/mongo.log

 

配置 mongo config 文件[/usr/local/mongodb/]

Vi mongo.conf

############# mongodb.conf ################

port=3001

dbpath=data

logpath=log/mongodb.log

logappend=true

############# mongodb.conf ################

 

启动 mongo [/usr/local/mongodb/]

sudo bin/mongod -f mongodb.conf 

 

 

vi /etc/sysconfig/iptables

添加:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3001 -j ACCEPT

 

Service iptables restart

posted @ 2016-09-05 17:16  游子善心  阅读(1)  评论(0编辑  收藏  举报  来源