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. Bitter.Core系列 十二 :Bitter ORM NETCORE ORM 全网最粗暴简单易用高性能的 NETCore 之 支持的 where 条件表达式

    Bitter.Core 内置了支持大部分的 linq 的条件表达式.基本上符合我们 where 条件所需.Bitter.Core 的支持 表达式内置  扩展 有: EndsWith    在Sql 解 ...

  2. Simple decorator that intercepts connection errors and ignores these if settings specify this.

    django-redis/cache.py at master · jazzband/django-redis https://github.com/jazzband/django-redis/blo ...

  3. (SqlServe)关于字符串长度被截断的问题

    1. 问题描述 在同步数据时常常会发现一个错误:将截断字符串或二进制数据. 2. 问题原因 这个问题出现的原因是:要插入的数值字段的长度超出了数据库中字段的长度.比如:插入的字符串字节长度是40,数据 ...

  4. SDS——动态字符串

    Redis中简单动态字符串sds数据结构与API相关文件是:sds.h, sds.c. SDS本质上就是char *,因为有了表头sdshdr结构的存在,所以SDS比传统C字符串在某些方面更加优秀,并 ...

  5. hbuilder使用技巧总结

    HBuilder是DCloud(数字天堂)推出的一款支持HTML5的Web开发IDE.HBuilder的编写用到了Java.C.Web和Ruby.HBuilder本身主体是由Java编写,它基于Ecl ...

  6. 玩转IDEA项目结构Project Structure,打Jar包、模块/依赖管理全搞定

    前言 你好,我是A哥(YourBatman). 如何给Module模块单独增加依赖? 如何知道哪些Module模块用了Spring框架,哪些是web工程? IDEA如何打Jar包?打War包? 熟练的 ...

  7. HTMl5 特点 标签语法 以及标签

    知识点关于HTML5 的特点以及其标签和标签语法.. <!-- [HTMl5 特点] 向下兼容 用户至上 化繁为简 无插件范围 访问通用性 引入语义 引入原生媒体支持--> <!-- ...

  8. Spring5源码,Spring DispatecherServlet的生命周期

    一.前端控制器模式 二.DispatcherServlet的执行链 三.DispatcherServlet 1.策略初始化 2.请求预处理 3.请求处理 4.视图解析 5.处理调度请求 - 视图渲染 ...

  9. 面向对象编程(封装、封装的意义、封装与扩展性、@property)

    1.封装之如何实现属性的隐藏 封装: __x=1 # 把数据属性隐藏 (如何实现隐藏) 类定义阶段 __开头发生了变形 __x --> _A__x特点: 1.在类外部无法直接:obj.__Att ...

  10. RESTFul应用分析

    Restful API 近年来应用越来越广泛,各大互联网公司纷纷推出了自己的 Restful API 服务. 本文将从实际应用出发,从 REST 到 Restful 再到 Restful API ,逐 ...