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

Install mongodb on rhel6

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

Share

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

Download: mongodb-linux-x86_64-3.2.6.tgz

Please go to mongodb's official website to download, this address does not provide downloads.

Upload mongodb-linux-x86_64-3.2.6.tgz to/usr/local

tar xvfz mongodb-linux-x86_64-3.2.6.tgzmv mongodb-linux-x86_64-3.2.6 mongodbchown -R mongo:dbmon mongodb

Installation is complete, mongodb installation is the decompression process.

Here is the startup:

cd mongodb

bin/mongod --dbpath=/data/mongodb/

Specifies the directory where the data file is located, default is/data/db. If the session executing this startup command is turned off, mongodb is also turned off. If you want it to run in the background, you need to add the fork parameter, and if you specify fork, you need to specify the logpath parameter.

You can edit a parameter file and specify the parameter file to start at startup. Specify the relevant parameters in the parameter file.

First create configuration files, data files, log files path

cd /usr/local/mongodbmkdir datamkdir etcmkdir logscd etctouch mongodb.cnfjournal=truebind_ip=xxx.xxx.xxx.xxxport=27017httpinterface=truerest=truestorageEngine=mmapv1dbpath=/usr/local/mongodb/datafork=truelogpath=/usr/local/mongodb/logs/mongodb.logprofile=1slowms=1replSet=xbfax

Specify parameter file startup

cd /usr/local/mongodbbin/mongod -f /usr/local/mongodb/etc/mongodb.cnf

Client connections:

bin/mongo xxx.xxx.xxx.xxx:27017MongoDB shell version: 3.2.6connecting to: xxx.xxx.xxx.xxx:27017/testWelcome to the MongoDB shell.For interactive help, type "help".For more comprehensive documentation, see http://docs.mongodb.org/Questions? Try the support group http://groups.google.com/group/mongodb-user

Or use graphical tools on windows: MongoVUE

About MongoVUE please google yourself

Here are some explanations of the relevant parameters:

journal Enable log option, MongoDB data operations will be written to the journal folder file, default is true

bind_ip is bound to the service IP. If bound to 127.0.0.1, it can only be accessed locally, and all local IPs are not specified by default.

port Specifies the service port number, default port 27017

httpinterface http interface

rest Open rest API

storageEngine Start engine

dbpath Data file storage path

fork runs MongoDB as a daemon, creating server processes

logpath Specifies the MongoDB log file, note that the specified file is not a directory

profile parameters 0=off 1=slow, 2=all

slowms value of slow for profile and console log

replSet Sets the replica set name

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