Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Devops
  3. Question
Devops

What's a clean way to stop mongod on Mac OS X?

Asked by Deepali Singh Jul 15, 2021 1.4K views 1 answer
Share

About this question

I’m running mongo 1.8.2 and trying to see how to stop mongodb mac ?

on our Ubuntu servers I can shutdown mongo cleanly from the mongo shell with:

> use admin
> db.shutdownServer()

but on my Mac, it does not kill the mongod process. the output shows that it 'should be' shut down but when I ps -ef | grep mongo it shows me an active process. also, I can still open a mongo shell and query my DBS like it was never shut down.

the output from my db.shutdownServer() locally is:

MongoDB shell version: 1.8.2 
connecting to: test 
> use admin 
switched to db admin 
> db.shutdownServer() 
Tue Dec 13 11:44:21 DBClientCursor::init call() failed 
Tue Dec 13 11:44:21 query failed : admin.$cmd { shutdown: 1.0 } to: 127.0.0.1 server should be down... 
Tue Dec 13 11:44:21 trying reconnect to 127.0.0.1 
Tue Dec 13 11:44:21 reconnect 127.0.0.1 failed couldn't connect to server 127.0.0.1 Tue Dec 13 11:44:21 Error: error doing query: unknown shell/collection.js:150

I know I can just kill the process but I’d like to do it more cleanly.

Your answer

1 Answer

More Devops discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest DevOps Blogs

Guides, tips and career advice on DevOps from JanBask experts.