网上有关于如何使用Monit监控delayed_job的例子吗?
我能找到的一切都使用了上帝,但我拒绝使用上帝,因为在Ruby中长期运行的过程通常很糟糕.(上帝邮件列表中最新的帖子?上帝内存使用量稳步增长.)
更新: delayed_job现在附带一个基于此问题的示例监听配置.
我发现调试monit是一个很大的痛苦.Monit的shell环境基本上没有任何东西(没有路径或其他环境变量).此外,我找不到任何日志文件.
问题是,如果monit脚本中的start或stop命令失败,则很难辨别出它有什么问题.通常它不像在shell上运行命令那么简单,因为shell环境与monit shell环境不同.
人们使用什么技术来调试monit配置?
例如,我很乐意有一个monit shell,来测试我的脚本,或者一个日志文件,看看出了什么问题.
我安装了monit并尝试使用以下命令检查状态.
monit status
Run Code Online (Sandbox Code Playgroud)
但最终会出现以下错误.
monit: error connecting to the monit daemon
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
我们有一个自定义设置,它有几个守护进程(Web应用程序+后台任务)运行.我正在寻找使用一种服务,它可以帮助我们监视这些守护进程,并在资源消耗超过一个级别时重新启动它们.
我会欣赏任何关于何时一个人比另一个更好的见解.据我所知,monit会在supervisord启动子流程时旋转一个新进程.这种方法的优点和缺点是什么?
我也将使用暴发来监控monit或supervisord本身.webapp部署将使用capistrano完成.
谢谢
我想在monit处理一种连锁动作.
我的尝试(到目前为止):
check process myprocess with pidfile /run/my.pid
start program = "/path/to/binary start" with timeout 60 seconds
stop program = "/path/to/binary stop" with timeout 60 seconds
if not exist for 3 cycles then restart
if not exist then alert
if 3 restarts within 3 cycles then timeout
Run Code Online (Sandbox Code Playgroud)
在故障PID时不报警并保持状态"运行",但在3个周期后重新启动.
check process myprocess with pidfile /run/my.pid
start program = "/path/to/binary start" with timeout 60 seconds
stop program = "/path/to/binary stop" with timeout 60 seconds
if not exist for 3 cycles …Run Code Online (Sandbox Code Playgroud) 我有一堆长期运行的Ruby脚本,我想确保每隔30秒左右就会出现这些脚本.
我通常只是简单地启动命令 ruby script-name.rb
如何配置monit来管理这些脚本?
更新:我试图按照这个方法创建一个包装脚本然后启动ruby进程,但它似乎没有创建.pid文件并输入'./wrapper-script stop'什么也没做:/
我应该在ruby中编写pid还是使用包装器脚本来创建monit所需的pid?
我们的sysadmin最近切换到使用monit,所以现在当我想重新启动服务时,我应该使用"monit restart <servicename>"而不是"/etc/init.d/ <servicename> restart".
但是,monit命令在成功时不会产生任何输出并立即返回.看起来直到下一个周期之后它才真正重启.
我正在重新启动服务,因为我对它进行了更改.我不想测试我对旧实例的更改.所以我需要知道重启完成的时间.当我告诉它时,我也希望它重新启动,而不是当它转向它时.在我等待的时候,我不喜欢一遍又一遍地输入"ps aux | grep <myservicename>".
有没有办法让monit立即重启我的服务?
有没有办法让monit,或者monit的包装器阻塞,直到重启完成?
有没有办法让monit告诉我重启成功,否则它失败了?
monit ×10
linux ×3
monitoring ×3
ruby ×3
god ×2
ubuntu ×2
upstart ×2
alert ×1
daemon ×1
debian ×1
debugging ×1
delayed-job ×1
deployment ×1
node.js ×1
python ×1
restart ×1
shell ×1
supervisord ×1
unix ×1