Install MongoDB3.0.3 on CentOS6
Version: Mongodb-linux-x86_64-rhel62-3.0.5.tgz
Installing OpenSSL
#yum install-y Openssl-devel openssl-y
1. Download MongoDB
# wget Https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.0.5.tgz
2. Start the installation
MongoDB default installed database directory/data/db, default port 27017
# mkdir-p/home/www/
# tar zxvf mongodb-linux-x86_64-rhel62-3.0.5.tgz-c/home/
# Mv/home/mongodb-linux-x86_64-rhel62-3.0.5/home/mongodb
# Cd/home/mongodb
# mkdir-p etc
# MKDIR-P Data
# mkdir-p Logs
Custom configuration Files
# vi/home/mongodb/etc/mongodb.conf
port=20000
Dbpath=. /data
Logpath=. /logs/mongodb.log
Logappend=false
Fork=true
maxconns=5000
bind_ip=127.0.0.1,192.168.2.128
Noauth=true
Nohttpinterface=true
Rest=true#启用WEB控制台, the default port for the Web console is 28017
Start:
#cd/home/mongodb/bin
#./mongod-f. /etc/mongodb.conf--smallfiles
#netstat-ntpl#查看mongodb是否启动
Finally, the MongoDB port is added to the iptables
Randomly start MongoDB as a Linux service
# vi/etc/rc.local
Add the following line of code to it
/home/mongodb/bin/mongod--dbpath=/home/mongodb/data--logpath=/home/mongodb/logs/mongodb.log
Linux under MongoDB installation and configuration