how to stop MongoDB from the command line_mongod how to stop MongoDB from the command line stop mongod kill -9



how to stop MongoDB from the command line

stop mongod

# start 
# server
$ mongod --dbpath /System/Volumes/Data/data/db

# stop
$ mongod --shutdown
# Ctrl + C
# kill <mongod process ID>

# Shut down the mongod from the mongo shell using the db.shutdownServer() method as follows:
> use admin
> db.shutdownServer()


how to stop MongoDB from the command line_mongo_02

how to stop MongoDB from the command line_mongo_03

stop mongodb

$ which mongod
# /usr/local/mongodb/bin/mongod

# start
./mongod

# stop

$ db.adminCommand({ shutdown: 1 })
$ db.adminCommand({ shutdown: 1, force: true })

$ use admin
$ db.shutdownServer()

$ mongod --shutdown

$ kill <mongod process ID>
$ kill -2 <mongod process ID>

# WARNING
# Never use kill -9 (i.e. SIGKILL) to terminate a mongod instance.



SIGKILL

​kill -9 PID​

how to stop MongoDB from the command line_stop mongodb_04


# MacOS PID kill
$ top



env​

$ which .zshrc
$ which flutter

# edit $HOME/.zshrc

$ cat $HOME/.zshrc
$ vim $HOME/.zshrc
$ code . $HOME/.zshrc

export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"

$ echo $PATH

# refresh
$ source $HOME/.zshrc


how to stop MongoDB from the command line_mongod_05

how to stop MongoDB from the command line_mongod

how to stop MongoDB from the command line_mongod_07

$ echo $PATH

# refresh
$ source $HOME/.zshrc

$ which mongod

$ code .zshrc

export PATH=/usr/local/mongodb/bin:$PATH

$ ps -ef | grep mongod

$ ps -ef | grep mongo


how to stop MongoDB from the command line_stop mongodb_08


# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH

# Path to your oh-my-zsh installation.
export ZSH="/Users/xgqfrms-mbp/.oh-my-zsh"

# tree bug
source ~/.bash_profile


# Flutter China
export PUB_HOSTED_URL=https://pub.flutter-io.cn

# flutter PATH & zsh
export PATH="$PATH:/Users/xgqfrms-mbp/Documents/Flutter/flutter/bin"

# mongodb ENV 2020.04.23
export PATH=/usr/local/mongodb/bin:$PATH

# VS Code & zsh bug
# export PATH="\$PATH:/Users/xgqfrms-mbp/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
function code {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
local argPath="$1"
[[ $1 = /* ]] && argPath="$1" || argPath="$PWD/${1#./}"
open -a "Visual Studio Code" "$argPath"
fi
}
# nvm config
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" # This loads nvm bash_completion


# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
)

source $ZSH/oh-my-zsh.sh

# User configuration

# export MANPATH="/usr/local/man:$MANPATH"


# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"



refs