
- #MAC SHUTDOWN FROM COMMAND LINE HOW TO#
- #MAC SHUTDOWN FROM COMMAND LINE DRIVERS#
- #MAC SHUTDOWN FROM COMMAND LINE WINDOWS#
#MAC SHUTDOWN FROM COMMAND LINE WINDOWS#
rabbitmqctl in a Windows installation willĪdditional tools are optional and can be obtained from GitHub: On Windows, the above tool names will end with. They can be found under the sbin directory in installation root.

I had started mongod with a custom command line :-) (macOS specific) Before anyone wonders: no, I could not stop it with command brew services stop mongodbīecause I did not start it with brew services start mongodb Meanwhile option -shutdown is marked in the documentation as " Supported on Linux only". Note: I resorted to using signals because mongod -shutdown, although mentioned in the current MongoDB documentation, did not work on my machine (macOS, mongodb v3.4.10, installed with homebrew): Error parsing command line: unrecognised option '-shutdown' If the DB is running as another user, but you have administrative rights, you have invoke the above commands with sudo, in order to run them. Or, much more safer, only to the processes belonging to you: pkill -U $USER mongod If you have more than one instance running or you don't care about the PID, you could use pkill to send the signal to all running mongod processes: pkill mongod Which sends signal 15 (SIGTERM), or kill -2 PID One of the following commands can be used (PID represents the Process ID of the mongod process): kill PID I followed the official MongoDB documentation for stopping with signals.
#MAC SHUTDOWN FROM COMMAND LINE HOW TO#
To learn more about the problems of an unclean shutdown, how to best avoid such a scenario and what to do in the event of an unclean shutdown, please see: Recover Data after an Unexpected Shutdown. Or on Windows if you have installed as a service named MongoDB:Īnd if not installed as a service (as of Windows 7+) you can run: Kill the process by $ kill ( the Mongo docs have more info on this) It also details the risks of incorrectly stopping MongoDB (such as data corruption) and talks about the different kill signals.Īdditionally, if you have installed MongoDB using a package manager for Ubuntu or Debian then you can stop mongodb (currently mongod in ubuntu) as follows:

#MAC SHUTDOWN FROM COMMAND LINE DRIVERS#
It explains the various options of stopping MongoDB through the shell, cli, drivers etc. Starting and Stopping MongoDB is covered in the MongoDB manual.
