Mongodb mongod start and stop

1. Start mongodb on port 27017
[code language=”shell”]
monogod –port 27017
[/code]

2. Start mongodb on port 27018 with log file and database storage file locations
[code language=”shell”]
mongod –port 27018 –dbpath /path/to/your/db/files/ –logpath /path/to/your/log/files
[/code]

3. Stop mongodb by killing the process from command line
[code language=”shell”]
ps -ef | grep mongo #this command shows you the mongodb process id
kill 12345 #kill the process
[/code]

4. Stop mongodb from the mongodb shell
[code language=”shell”]
mongo –port 27017
use admin;
db.shutdownServer();
[/code]

Search within Codexpedia

Custom Search

Search the entire web

Custom Search