Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and configuration of MongoDB under Linux

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Install MongoDB3.0.3 on CentOS6

Version: mongodb-linux-x86_64-rhel62-3.0.5.tgz

Install 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

two。 Start 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 Profil

# 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.1192.168.2.128

Noauth=true

Nohttpinterface=true

Rest=true # enables the WEB console. The default port of the WEB console is 28017

Start:

# cd / home/mongodb/bin

#. / mongod-f.. / etc/mongodb.conf-- smallfiles

# netstat-ntpl # check whether mongodb is started

Finally, add the port of mongodb to the iptables

Start MongoDB randomly 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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report