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. https://github.com/golang/go/wiki/CommonMistakes

    CommonMistakes https://golang.org/doc/faq#closures_and_goroutines Why is there no goroutine ID? ¶ Go ...

  2. Android LocationManagerService启动(一)

    Location服务是系统中很重要的一个服务,几乎当前所有的App都会用到这个服务. 首先看代码在Android源码的位置 Android API frameworks/base/location L ...

  3. SQLyog破解30天到期

    开始--运行中输入regedit.找到regedit.exe 文件   点击regedit.exe...就把注册表编辑器打开了   我们需要找到记录软件使用实现的数据...找到HKEY-CURRENT ...

  4. is == id ,编码

    一. id 查询内存地址. # name = 'alex' # print(id(name)) # name1 = 'alex' # name2 = 'alex' # print(name1 == n ...

  5. 题解【CF1444A Division】

    题面 t 组数据. 给定参数 p,q,求一个最大的 x,满足 \((x|p)∧(q∤x)\). \(1\le t \le 500\),\(1\le p \le10^{18}\),\(2\le q\le ...

  6. Java基础图解,JVM,线程,Spring,TCP,SpringMVC等开发体系图解

    Java基础图解,JVM,线程,Spring,TCP,SpringMVC等开发体系图解 1.Java虚拟机运行时数据区图 2. 堆的默认分配图 3.方法区结构图 4.对象的内存布局图 5.对象头的Ma ...

  7. 输入DStream之基础数据源以及基于HDFS的实时wordcount程序

    输入DStream之基础数据源以及基于HDFS的实时wordcount程序 一.Java方式 二.Scala方式 基于HDFS文件的实时计算,其实就是,监控一个HDFS目录,只要其中有新文件出现,就实 ...

  8. SLAM01

    上周末发现了一个巨大的问题,就是我们目前构建的室内定位的方法中,一个基本的假设是错的----这就非常尴尬了. 于是乎赶紧抱一波佛脚,学习一下slam里相关的问题是怎么解决的,找找灵感. 结果看了个开头 ...

  9. Spring boot AOP 记录请求日志

    如何将所有的通过url的请求参数以及返回结果都输出到日志中? 如果在controller的类中每个方法名都写一个log输出肯定是不明智的选择. 使用spring的AOP功能即可完成. 1. 在pom. ...

  10. LInux-Lamp搭建

    LInux-Lamp搭建 一 yum安装(自动会下载依赖包) (一)mysql安装 检测是否安装: yum list installed mysql* rpm -qa | grep mysql* 安装 ...