Mongodb mongod start and stop

1. Start mongodb on port 27017

monogod --port 27017

2. Start mongodb on port 27018 with log file and database storage file locations

mongod --port 27018 --dbpath /path/to/your/db/files/ --logpath /path/to/your/log/files

3. Stop mongodb by killing the process from command line

ps -ef | grep mongo #this command shows you the mongodb process id
kill 12345 #kill the process

4. Stop mongodb from the mongodb shell

mongo --port 27017
use admin;

Search within Codexpedia

Custom Search

Search the entire web

Custom Search