问题描述
我正在配置我的服务器来运行node.js作为守护进程。我设置了Upstart来处理节点的启动和关闭,这是非常有用的。下一步是确保node.js在死机时重新启动。一些建议使用(或)来监控过程(在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,这使得实际的请求将更加忠实地为您提供应用程序理解的答案。一个进程可能会高兴地运行,但是以某种方式停止,以致不能提供请求。
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设置有益吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!