如何保持我的应用程序始终运行? - 节点JS
我将应用程序部署到AWS EC2上,因此我需要一种让该节点应用程序运行的方法,无论服务器是否重新启动,如果应用程序崩溃了是否始终需要重新启动该应用程序。 该应用需要始终运行。因此,我使用npm start&
是否足以重新启动我的应用?
我尝试使用SystemD,但是在启动创建的服务时我有错误:
sudo systemctl start nameX.service
namex的工作。服务失败,因为资源不可用或 另一个系统错误。请参阅“ SystemCtl状态...服务”和 详细信息“ Journal Cttl -Xeu ....服务”。
sudo systemctl status nameX.service
namex.service:计划重新启动作业,重新启动> Systemd [1]:停止 我的节点服务器。无法加载环境文件> Systemd [1]: ...服务:无法运行“启动”任务:no> Systemd [1]:...服务: 结果“资源”失败。 Systemd [1]:无法启动我的节点 服务器。
I deployed my app to aws EC2 so I need a way of always having this node app running no matter what if the server restart if the app crashes whatever it always need to restart the app.
the app needs to running always. so I use npm start &
is that enough to restart my app?
I've tried to use systemD, but I had error while start the service I've created :
sudo systemctl start nameX.service
Job for nameX.service failed because of unavailable resources or
another system error. See "systemctl status ...service" and
"journalctl -xeu ....service" for details.
sudo systemctl status nameX.service
nameX.service: Scheduled restart job, restart > systemd[1]: Stopped
My Node Server. Failed to load environment file> systemd[1]:
...service: Failed to run 'start' task: No > systemd[1]: ...service:
Failed with result 'resources'. systemd[1]: Failed to start My Node
Server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论