2011-05-20 55 views

回答

6

您可以將第一個工作人員的配置複製N次。 假設你有5名工人,你會監控他們都具有以下:

例如,如果只delayed_job.4.pid下降
check process delayed_job.0 
    with pidfile /path/to/shared/pids/delayed_job.0.pid 
    start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user" 
    stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user" 

check process delayed_job.1 
    with pidfile /path/to/shared/pids/delayed_job.1.pid 
    start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user" 
    stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user" 

check process delayed_job.2 
    with pidfile /path/to/shared/pids/delayed_job.2.pid 
    start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user" 
    stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user" 

check process delayed_job.3 
    with pidfile /path/to/shared/pids/delayed_job.3.pid 
    start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user" 
    stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user" 

check process delayed_job.4 
    with pidfile /path/to/shared/pids/delayed_job.4.pid 
    start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user" 
    stop program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job stop' - user" 
+6

這是否有問題的潛力?它不會啓動5個以上的節點嗎? – Bradley 2013-08-21 15:07:58

+2

@Bradley不,它不會,如果你嘗試啓動5個工人,而例如2已經在運行,delayed_job只會啓動3個新工人,並保持前2個運行。 – 2015-08-02 21:23:10