shutdown
-
shutdown
-
The
shutdown
command cleans up all database resources and then terminates the process. You must issue theshutdown
command against the admin database in the form:Note
Run the
shutdown
against the admin database. When usingshutdown
, the connection must originate from localhost or use an authenticated connection.If the node you’re trying to shut down is a replica set primary, then the command will succeed only if there exists a secondary node whose oplog data is within 10 seconds of the primary. You can override this protection using the
force
option:Alternatively, the
shutdown
command also supports atimeoutSecs
argument which allows you to specify a number of seconds to wait for other members of the replica set to catch up:The equivalent
mongo
shell helper syntax looks like this: