Article From:https://www.cnblogs.com/timeTraveler/p/9906708.html

Edition

MongDB4.0.3

install

tar -zxvf mongodb-linux-x86_64-rhel62-4.0.3.tgz
The default data directory is / data / db, or you can specify a directory
Start command
./bin/mongod
The default port is 27017
Then add — dbpath to specify the data directory — dbpath=/opt/mongo_data (directory must be created manually first)
–forkRepresents background boot
–logpathYou can specify the log directory — logpath=/opt/logs

./bin/mongo
Background management shell accessible to mongodb

Close MongDB
Execute in the shell
use admin
db.shutdownServer()

 

Link of this Article: Installing MangoDB on Linux

Leave a Reply

Your email address will not be published. Required fields are marked *