node.js - pm2 Node 模块能否在crash后自动重​​启app

标签 node.js pm2

我有一个可用的 Node.js 应用程序,但存在导致应用程序崩溃的已知和未知错误。在这种情况下,如果 pm2 可以重新启动 Node 应用程序会很好。 pm2 中是否已经提供此功能?

最佳答案

是的,默认情况下它会这样做。如需更多信息,请参阅 Restart strategies .

如果应用在短时间内反复无法启动,pm2 可能会停止重启。见 configurationmin_uptimemax_restarts

关于node.js - pm2 Node 模块能否在crash后自动重​​启app,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26135371/

相关文章:

node.js - 卡夫卡 Node : manage multiple consumer groups

node.js - 运行配置文件时填充 "Process finished with exit code 199"

reactjs - PM2 和 nextjs 在运行一段时间后停止响应请求

node.js - 为什么 PM2 没有启动我的 Node 进程?

node.js - PM2 - 使用 NodeJS 参数运行 Coffeescript 文件

java - 如何知道 Azure 中的虚拟机是否已停止

javascript - Mongoosejs 刷新文档

javascript - 如何从 grunt 任务函数运行终端命令

PM2-健康 : can i use pm2-health module for sending email alerts/notifications?

node.js - Node js、socket.io、redis 和 pm2