5
我讀了很多關於監視與monit delayed_job。這個實現非常簡單直接。但是,當一名工人不夠時,我該如何設置監控來確保這一點,比方說,10名工人正在不斷運行?監視多個延遲的工作人員與監視
我讀了很多關於監視與monit delayed_job。這個實現非常簡單直接。但是,當一名工人不夠時,我該如何設置監控來確保這一點,比方說,10名工人正在不斷運行?監視多個延遲的工作人員與監視
您可以將第一個工作人員的配置複製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"
這是否有問題的潛力?它不會啓動5個以上的節點嗎? – Bradley 2013-08-21 15:07:58
@Bradley不,它不會,如果你嘗試啓動5個工人,而例如2已經在運行,delayed_job只會啓動3個新工人,並保持前2個運行。 – 2015-08-02 21:23:10