Database Manual / Self-Managed Deployments / Administration

Exit Codes and Statuses for a Self-Managed Deployment自我管理部署的退出代码和状态

MongoDB will return one of the following codes and statuses when exiting. Use this guide to interpret logs and when troubleshooting issues with mongod and mongos instances.MongoDB退出时将返回以下代码和状态之一。使用本指南解释日志,并在排除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. The instance exits cleanly.数据库的版本与mongod(或mongod.exe)实例支持的版本不同。实例干净地退出。
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. The system exits without performing a clean shutdown.由遇到不可恢复错误、未捕获异常或未捕获信号的MongoDB应用程序返回。系统退出时不会执行干净关机。
20

Message: ERROR: wsastartup failed <reason>

Returned by MongoDB applications on Windows following an error in the WSAStartup function, used to initialize the networking subsystem.在WSAStartup函数发生错误后,Windows上的MongoDB应用程序返回,用于初始化网络子系统。

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. The process exits cleanly.如果守护进程未能发送就绪信号,则mongod在服务器初始化期间返回。该过程干净地退出。
61Returned by the Storage Node Watchdog if any of the filesystems with monitored directories are unresponsive.如果具有受监视目录的任何文件系统没有响应,则由存储节点监视器返回。
62

Returned 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, refer to the release notes for your version of MongoDB and search for "Compatibility Changes."要解决升级后的数据不兼容问题,请参阅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返回。