【问题标题】:how to make foreman start god如何让工头开始上帝
【发布时间】:2012-10-24 19:17:03
【问题描述】:

我有一个这样的 Procfile:

web: bundle exec unicorn -c config/unicorn.rb -E production
god: god -c services.god

但是foreman start god 没有开始……只是这样说:

17:14:32 god.1  | started with pid 29506
17:14:32 god.1  | exited with code 0
17:14:32 system | sending SIGTERM to all processes
SIGTERM received

如果我运行god -c services.god,所有服务都运行良好...
有什么想法吗?
谢谢

【问题讨论】:

    标签: ruby ruby-on-rails-3 foreman god


    【解决方案1】:

    你不应该和工头一起跑神。 foreman 用于指定应用程序中的所有后台(和 Web)进程,god 是这些进程的进程监控框架。

    通常,您应该:

    1. 直接在Procfile(而不是services.god)中指定所有进程,并使用foreman start 在开发中运行它们。
    2. 使用上帝来监控生产过程。我使用我的foreman_god gem 直接用上帝加载 Procfile。或者,您可以export a god config file

    也就是说,如果你真的想从工头运行上帝:上帝默认作为守护程序运行,而守护程序不能与工头一起工作(请参阅this wiki page)。如果您将 -D(不守护进程)选项传递给上帝,它应该可以工作:

    god: god -D -c services.god
    

    【讨论】:

      【解决方案2】:

      如果你在 rvm 中使用 God,你可能应该使用类似的东西,

      god: rvmsudo god -c /path_to_yourgod_file.god
      

      但是为什么您需要两个不同的监控系统,而您可以使用其中任何一个来完成您的工作?

      【讨论】:

      • 我不再使用 rvm...“两个不同的监控系统”是什么意思?
      猜你喜欢
      • 2016-11-17
      • 1970-01-01
      • 1970-01-01
      • 2021-10-04
      • 2014-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多