how to stop MongoDB from the command line

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



xgqfrms 2012-2020

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


how to stop MongoDB from the command line的更多相关文章

  1. How to build .apk file from command line(转)

    How to build .apk file from command line Created on Wednesday, 29 June 2011 14:32 If you don’t want ...

  2. Can't use Subversion command line client: svn Probably the path to Subversion executable is wrong. Fix it.

    1.最近使用SVN工具时,Checkout出项目到本地后后,然后将其导入到Intellij idea中开发,在提交svn代码的时候,出现这样的错误:Can't use Subversion comma ...

  3. How to Use Android ADB Command Line Tool

    Android Debug Bridge (adb) is a tool that lets you manage the state of an emulator instance or Andro ...

  4. Chrome-Console( Command Line API Reference)

    来源于:https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference The Comma ...

  5. logoff remote desktop sessions via command line tools

    This trick I learned from my one of ex-college.  In Windows servers, only two remote desktop session ...

  6. 使用intellij的svn时提示出错: Can't use Subversion command line client: svn.Errors found while svn working copies detection.

    使用Intellij的svn时提示出错:Can't use Subversion command line client: svn. Errors found while svn working co ...

  7. ubuntu16.04安装virtualbox5.1失败 gcc:error:unrecognized command line option ‘-fstack-protector-strong’

    系统:ubuntu16.04.1 软件:Virtualbox-5.1 编译器:GCC 4.7.4 在如上环境下安装Vbx5.1提示我在终端执行/sbin/vboxconfig命令 照做 出现如下err ...

  8. Linux Command Line 笔记(1)

    Yunduan CUI graphical user interfaces make easy tasks easy, while command line interfaces make diffi ...

  9. Can't use Subversion command line client:svn

    在Intellij IDEA里checkout东西时出先这个错误提示:Can't use Subversion command line client:svn Subversion command l ...

随机推荐

  1. 手淘架构组最新实践 | iOS基于静态库插桩的⼆进制重排启动优化 抖音研发实践:基于二进制文件重排的解决方案 APP启动速度提升超15% 编译期插桩

    抖音研发实践:基于二进制文件重排的解决方案 APP启动速度提升超15% 原创 Leo 字节跳动技术团队 2019-08-09 https://mp.weixin.qq.com/s/Drmmx5JtjG ...

  2. dict 切片 间隔取值

    1. 字典型d[k].d.get(k),如果键名不存在 报错.返回None 2. 可以为键设置不存在情况的下的覆盖None的返回值 3. 字符串str可以看成是list 4. 对字符串的截取通过切片实 ...

  3. Java 复习整理day04

    在我们的日常生活中,方法可以理解为要做某件事情, 而采取的解决办法. 如:小明同学在路边准备坐车来学校学习.这就面临 着一件事情(坐车到学校这件事情)需要解决,解决办法 呢?可采用坐公交车或坐出租车的 ...

  4. php之PDOStatement::execute数组参数带有键值会出错

    当预处理的SQL语句是用问号占位符时,如果是用数组传参的,数组里不要带有键值,否则无法执行SQL. 出错的代码如下: $test = new PDODB(); $param=["d" ...

  5. 解决 error MSB4057: 该项目中不存在目标“_CopyWebApplication” 问题

    在使用MSBuild 编译项目的时候报错: 解决办法: 在Web项目中,使用Nuget添加引用  MSBuild.Microsoft.VisualStudio.Web.targets 即可.

  6. hdu4348 To the moon (主席树 || 离线线段树)

    Problem Description Background To The Moon is a independent game released in November 2011, it is a ...

  7. 【noi 2.6_4982】踩方格(DP)

    题意:一个无限大的方格矩阵,能向北.东.西三个方向走.问走N步共有多少种不同的方案. 解法: f[i]表示走 i 格的方案数. 状态转移方程推导如下--设l[i],r[i],u[i]分别为第 i 步向 ...

  8. AcWing 239.奇偶游戏 (带权并查集/种类并查集)

    题意:你和朋友玩游戏,有个一\(01\)序列,你每次给出一个区间,朋友会回答这个区间中的\(1\)的个数是奇数还是偶数,但是你亲爱的朋友可能在撒谎,问在哪个询问你能确定你的朋友在撒谎,输出回合数. 题 ...

  9. POJ2429 GCD & LCM Inverse pollard_rho大整数分解

    Given two positive integers a and b, we can easily calculate the greatest common divisor (GCD) and t ...

  10. Codeforces Round #653 (Div. 3) E1. Reading Books (easy version) (贪心,模拟)

    题意:有\(n\)本书,A和B都至少要从喜欢的书里面读\(k\)本书,如果一本书两人都喜欢的话,那么他们就可以一起读来节省时间,问最少多长时间两人都能够读完\(k\)本书. 题解:我们可以分\(3\) ...