2013-09-26 28 views
0

我发现了很多关于监控Unicorn的信息,有人说其他配置脚本是错误的,并发布了他们自己的信息。似乎没有主配置,只是工作™如何监视(非零宕机)Unicorn?

我假设preload_app和零停机时间部署是主要的罪魁祸首。我很想拥有这个功能,但现在我更感兴趣的是只监控跑步,期间。所以目前我已关闭所有这些设置。

现在我正在使用capistrano-unicorn这是一个非常棒的宝石。

它给我所有capistrano部署钩我需要重新加载独角兽。该应用已成功部署它。

我想现在要做的主要事情是...

一)确保麒麟服务器上发生故障时自动启动/重新启动

b)监测麒麟重新启动工人说模具/挂机/什么。

如果我使用这个宝石,完成我的目标的最佳方法是什么(记住我不一定需要零宕机时间)?

感谢

回答

0

Engine Yard的使用Monit,这是不正是你需要什么漂亮的小工具!

这里是麒麟配置:

check process unicorn 
    with pidfile /path/to/unicorn.pid 
    start program = "command to start unicorn" 
    as uid yourUID and gid yourGID 
    stop program = "command to stop unicorn" 
    as uid yourUID and gid yourGID 
    if mem > 255.0 MB for 2 cycles then restart 
    if cpu > 100% for 2 cycles then restart 

    check process unicorn_worker0 
    with pidfile /path/to/unicorn_worker_0.pid 
    if mem > 255.0 MB for 2 cycles then exec "/bin/bash -c '/bin/kill -6 `cat /path/to/unicorn_worker_0.pid` && sleep 1'" 
...