- Reference >
- Database Commands >
- Administration Commands >
- shutdown
shutdown¶
-
shutdown¶ The
shutdowncommand cleans up all database resources and then terminates the process. You must issue theshutdowncommand against the admin database in the form:Note
Run the
shutdownagainst 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
forceoption:Alternatively, the
shutdowncommand also supports atimeoutSecsargument which allows you to specify a number of seconds to wait for other members of the replica set to catch up:The equivalent
mongoshell helper syntax looks like this: