xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

how to stop MongoDB from the command line All In One

how to stop MongoDB from the command line All In One

stop mongod

https://docs.mongodb.com/manual/tutorial/manage-mongodb-processes/#stop-mongod-processes

# 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()

https://stackoverflow.com/questions/11774887/how-to-stop-mongo-db-in-one-command/11777141

stop mongodb

https://docs.mongodb.com/manual/reference/command/shutdown

https://docs.mongodb.com/manual/tutorial/manage-mongodb-processes

$ 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

https://stackoverflow.com/questions/11774887/how-to-stop-mongo-db-in-one-command


# MacOS PID kill
$ top


env

https://flutter.dev/docs/get-started/install/macos#update-your-path

$ 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

$ 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


# 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

MongoDB shell

https://www.cnblogs.com/xgqfrms/p/13320793.html

MongoDB & macOS

https://www.cnblogs.com/xgqfrms/p/9770091.html

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2020-04-22 21:28  xgqfrms  阅读(410)  评论(13编辑  收藏  举报