Since the correct way to shutdown a service (net stop mongodb) does not work as expected in 2.0.6, I have attempted to use db.shutdownServer. This unfortionately does not work as expected. Since mongod installs itself with service failure actions to restart the service (love how it does this!), when mongo is shutdown using the shell, Windows seems to think that mongod has exited without the service being shut down, which causes it to automatically restart the service. Sample mongo shell output:
-------------------------------------
SECONDARY> db.serverStatus().uptime
531
SECONDARY> use admin
switched to db admin
SECONDARY> db.shutdownServer()
Mon Jun 11 11:07:09 DBClientCursor::init call() failed
Mon Jun 11 11:07:09 query failed : admin.$cmd
to: 127.0.0.1
server should be down...
Mon Jun 11 11:07:09 trying reconnect to 127.0.0.1
Mon Jun 11 11:07:10 reconnect 127.0.0.1 ok
SECONDARY> db.serverStatus().uptime
4
-------------------------------------
- is duplicated by
-
SERVER-27782 stop mongod (version 3.4.0, 3.4.1) windows service return error 1067
- Closed
- is related to
-
SERVER-6771 Windows Service: 'net stop mongodb' gives System error 109 has occurred. -- The pipe has been ended.
- Closed