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. C++ Primer Plus读书笔记(三)复合类型

    这节主要是介绍数组.结构体.类等概念,以及new delete内存管理. 1.数组 首先普及一下C++中字符串的概念,只有在结尾有 \0 的才叫字符串, cout 输出字符串也以空字符为标记进行结束输 ...

  2. Webpack4.0各个击破(5)module篇

    一. 模块化乱炖 脚本合并是基于模块化规范的,javascript模块化是一个非常混乱的话题,各种[*MD]规范乱飞还要外加一堆[*.js]的规范实现.现代化前端项目多基于框架进行开发,较为流行的框架 ...

  3. 洛谷P2687 & P1108

    一道求最长下降子序列和与最长下降子序列长度相同的方案数的DP 题意: 一串数字,找出最长下降子序列,记录他的长度 \(length\) 并输出 然后找出所有长度达到 \(length\) 的下降子序列 ...

  4. LOJ10015扩散

    10015. 「一本通 1.2 练习 2」扩散   题目描述 一个点每过一个单位时间就会向 4 个方向扩散一个距离,如图所示:两个点 a .b 连通,记作e(a,b) ,当且仅当 a.b 的扩散区域有 ...

  5. Mysql数据库用户及用户权限管理,Navicat设置用户权限

    Mysql数据库用户及用户权限管理,Navicat设置用户权限 一.Mysql数据库的权限 1.1 mysql数据库用户权限级别 1.2 mysql数据库用户权限 1.3 存放用户权限表的说明 二.用 ...

  6. Spark SQL 自定义函数类型

    Spark SQL 自定义函数类型 一.spark读取数据 二.自定义函数结构 三.附上长长的各种pom 一.spark读取数据 前段时间一直在研究GeoMesa下的Spark JTS,Spark J ...

  7. php之bindValue和bindParam的区别

    PDOStatement::bindValue -  把一个值绑定到一个参数 绑定一个值到用作预处理的 SQL 语句中的对应命名占位符或问号占位符. PDOStatement::bindParam - ...

  8. CyclicBarrier---可重用的循环栅栏

    很多文章只是提了下可重用,具体这个栅栏怎么可重用的,很多没有说明,这里会解开你的疑惑. CyclicBarrier是一个同步工具类,它允许一组线程互相等待,直到达到某个公共屏障点.与CountDown ...

  9. CF-1440C2 Binary Table (Hard Version) (构造,模拟)

    Binary Table (Hard Version) 题意 \(n*m(2\le n,m\le 100)\) 的01矩阵,每次可以选择一个宽度为2的子矩阵,将四个位置中的任意3个进行翻转,即0变1, ...

  10. 牛客网暑期ACM多校训练营(第二场)message

    传送门:https://ac.nowcoder.com/acm/problem/16631 题意 对于直线y=ax+b,给出n个的a[i]和b[i].m次询问,每次询问给出直线y=cx+d的c[i]和 ...