本文介绍了使用 Monit 而不是基本的 Upstart 设置有好处吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在配置我的服务器以将 node.js 作为守护进程运行.我已经设置了 Upstart 来处理节点的启动和关闭,效果很好.下一步是确保 node.js 在它死掉时重新启动.一些指南 建议使用Monit(或Fugue)来监控进程(在 Monit 的情况下,通过向服务器发出 HTTP 请求并等待响应).

I'm configuring my server to run node.js as a daemon. I've setup Upstart to handle startup and shutdown of node, which works wonderfully. The next step is to make sure that node.js is restarted if it dies. A few of the guides have suggested using Monit (or Fugue) to monitor the process (in Monit's case by doing an HTTP request to the server and waiting for a response).

我很高兴使用 Monit 或 Fugue 之类的东西,但我不确定为什么不(或不能)只使用 Upstart 的 重生功能.我假设 Upstart 会监视启动进程的 PID,如果它死了,就会再次启动它.Monit 或 Fugue 能给你什么 Upstart 没有的东西?

I'm happy to use something like Monit or Fugue, but I'm not sure why one wouldn't (or couldn't) just use Upstart's respawn feature. I assume Upstart will monitor the PID of the launched process and just kick it off again if it dies. What does Monit or Fugue give you that Upstart doesn't?

推荐答案

鉴于 Upstart 只是检查 PID,像 Monit 这样发出实际请求的工具将更忠实地为您提供应用程序健全性的答案.一个进程可能正在愉快地运行,但以某种方式卡住,以至于它无法为请求提供服务.

Given that Upstart just checks the PID, a tool like Monit that makes an actual request will provide you an answer of app sanity more faithfully. A process may happily be running but stuck in some way such that it is not serving requests.

这篇关于使用 Monit 而不是基本的 Upstart 设置有好处吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-29 06:38