MongoDB DBA · 题目 134 · 单选

18. Which of the following choices is the preferred method for stopping a running mongod process from the command line? Assume mongod was run without the --fork flag. Choose the best answer:

题目选项

  1. A.
    running killall mongod or taskkill mongod from the terminal
  2. B.
    running db.shutdownServer() from the mongo shell
  3. C.
    pushing ctrl + break or ctrl + c from the terminal where mongod is running
  4. D.
    running db.dropDatabase() from the mongo shell
  5. E.
    closing the terminal the mongod is running in

答案置信度:高

正确答案:B

解析语言:中文

未使用 --fork 时,推荐在 mongo shell 里执行 db.shutdownServer()(即 admin 库的 shutdown 命令),它会让 mongod 干净地刷盘并退出。killall、关终端、ctrl+c 都属于强制或非正常终止,dropDatabase 只是删库,都不是停服手段。

所在套题

此题在题库中有 3 条记录。公开详情合并相同题干和选项;完整公开题展示置信度最高的一条记录,其他题目仅展示摘要。按套学习保留每条记录原有的答案、解析和置信度。

作者 · 作品 · 开源

作者与 MongoDB 作品

专注数据平台、MongoDB 迁移同步与云运维产品研发。

有任何 MongoDB 需求,均可联系作者。

联系作者 ↗mlhp123@outlook.com

支持作者

如果题库对您有帮助,欢迎自愿扫码打赏。

支付宝扫码打赏作者打开打赏原图 ↗