0

ruby 1.9.2p280 を使用して Rubyonrails Web アプリをデプロイし、rubyonrails 3.07 を Apache パッセンジャーとdelayed_job をバックグラウンド ジョブとしてデプロイしています。

パッセンジャーだけでなく、delayed_job バックグラウンド ジョブも監視したいと考えています。

ステップバイステップガイドが見つかりませんでした。

どうもありがとうございます

4

1 に答える 1

1

以下の .monitrc ファイルを追加し、コマンドを実行しmonit reloadて構成を読み込みます。

/etc/monit/web.monitrc

check process apache with pidfile /var/run/apache2.pid
  start program = "/etc/init.d/apache2 start"
  stop program  = "/etc/init.d/apache2 stop"
  if cpu > 80% for 5 cycles then restart
  if totalmem > 300.0 MB for 5 cycles then restart
  if children > 250 then alert
  if failed port 80 with timeout 10 seconds then restart
  if 3 restarts within 5 cycles then timeout
  mode manual
  group web

/etc/monit/delayed_job.monitrc

check process delayed_job with pidfile /mnt/<project>/tmp/pids/delayed_job.pid
  start program = "/usr/bin/delayed_job_start"
  stop program = "/usr/bin/delayed_job_stop"
  mode manual
  group delayed_job

/usr/bin/delayed_job_start

#!/bin/sh

cd /mnt/<project> && RAILS_ENV=production ruby script/delayed_job start
于 2011-12-25T03:44:41.380 に答える