Docs HomeMongoDB Manual

Exit Codes and Statuses退出代码和状态

MongoDB will return one of the following codes and statuses when exiting. MongoDB在退出时将返回以下代码和状态之一。Use this guide to interpret logs and when troubleshooting issues with mongod and mongos instances.使用本指南来解释日志,以及在解决mongodmongos实例的问题时使用本指南。

Code代码Cause原因
0Returned by MongoDB applications upon successful exit.MongoDB应用程序在成功退出时返回。
1Returned by mongod as a generic failure when no other error codes apply.当没有其他错误代码应用时,mongod作为一般故障返回。
2The specified options are in error or are incompatible with other options.指定的选项有错误或与其他选项不兼容。
3Returned by mongod if there is a mismatch between hostnames specified on the command line and in the local.sources collection when running a replica set.如果在运行副本集时在命令行和local.sources集合中指定的主机名不匹配,则由mongod返回。
4The version of the database is different from the version supported by the mongod (or mongod.exe) instance. 数据库的版本与mongod(或mongod.exe)实例支持的版本不同。The instance exits cleanly.实例干净地退出。
5Returned by mongos if a problem is encountered during initialization.如果在初始化过程中遇到问题,则由mongos返回。
12Returned by the mongod.exe process on Windows when it receives a Control-C, Close, Break or Shutdown event.由Windows上的mongod.exe进程在接收到Control-C、Close、Break或Shutdown事件时返回。
14Returned by MongoDB applications which encounter an unrecoverable error, an uncaught exception or uncaught signal. 由遇到不可恢复错误、未捕获异常或未捕获信号的MongoDB应用程序返回。The system exits without performing a clean shutdown.系统在不执行干净关机的情况下退出。
20Message: ERROR: wsastartup failed <reason>
Returned by MongoDB applications on Windows following an error in the WSAStartup function, used to initialize the networking subsystem.Windows上的MongoDB应用程序在WSAStartup函数出错后返回,用于初始化网络子系统。
Message: NT Service Error
Returned by MongoDB applications for Windows due to failures installing, starting or removing the NT Service for the application. 由于安装、启动或删除应用程序的NT服务失败,由适用于Windows的MongoDB应用程序返回。
48Returned by mongod or mongos when an error prevents a newly started instance from listening for incoming connections.当错误阻止新启动的实例侦听传入连接时,由mongodmongos返回。
50Returned by mongod during server initialization if it fails to fork the process.mongod在服务器初始化期间返回,如果它未能分叉进程。
51Returned by mongod during server initialization if the daemon fails to send a ready signal. 如果守护进程未能发送就绪信号,则mongod在服务器初始化期间返回。The process exits cleanly.进程干净地退出。
61Returned by the Storage Node Watchdog if any of the filesystems with monitored directories are unresponsive.如果具有受监视目录的任何文件系统没有响应,则由存储节点监视程序返回。
62Returned by mongod when the datafiles in --dbpath are incompatible with the version of mongod currently running.--dbpath中的数据文件与当前运行的mongod版本不兼容时,mongod返回。
To resolve data incompatibility issues after upgrading, please refer to the release notes for your version of MongoDB and search for "Changes Affecting Compatibility."要解决升级后的数据不兼容问题,请参阅MongoDB版本的发布说明,并搜索“影响兼容性的更改”
87Returned by mongod or mongos when the process health check triggers a crash.进程健康检查触发崩溃时由mongodmongos返回。
100Returned by mongod when the process throws an uncaught exception.当进程抛出未捕获的异常时,mongod返回。
102Returned by mongod or mongos when the process fails to rotate audit logs on startup.当进程在启动时无法轮换审核日志时,由mongodmongos返回。