Skip to content

Instantly share code, notes, and snippets.

@jebai0521
Created February 1, 2015 05:57
Show Gist options
  • Save jebai0521/b8cce06abac69de6611f to your computer and use it in GitHub Desktop.
Save jebai0521/b8cce06abac69de6611f to your computer and use it in GitHub Desktop.
后台起mongod
# 方法1:(推荐)
# --fork 选项将会通知 mongod 在后台运行
/path/to/MongoDB_Dir/bin/mongod --logpath /path/to/file.log --logappend --fork
# 方法2:
# 将输出重定向到 file.log 文件
# & 将该进程置于后台运行
/path/to/MongoDB_Dir/bin/mongod >> /path/to/file.log &
# 还可以这样运行(不记录日志)
# 因为所有重定向到位桶文件 /dev/null 的信息都会被丢弃
/path/to/MongoDB_Dir/bin/mongod >> /dev/null &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment