0 votes
1 view
in Web Technology by (29k points)

I am very new at Mongo. I am running mongod as described here in Mac OS X. I am running two mongod processes from the command line. If I need to stop the mongod processes I just execute kill <pid of mongod>. Is it the recommended way to stop mongod?

1 Answer

0 votes
by (64k points)

$mongo admin --eval "db.shutdownServer()"

MongoDB shell version: 2.6.4

connecting to: admin

2015-02-19T10:54:22.574+0200 DBClientCursor::init call() failed

server should be down...

It's returning some odd messages, but it works.

And I have made alias-command for running it easy.

alias stop-mongo='/opt/mongo/release/bin/mongo admin --eval "db.shutdownServer()"'

This works at least if you start your mongo manually (e.g. with --fork option).

Related questions

0 votes
1 answer
0 votes
2 answers
asked Oct 16, 2019 in Web Technology by Sammy (47.8k points)
0 votes
3 answers
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...