繁体   English   中英

监控:重新启动失败

[英]monit: failed to restart

我正在为sidekiq使用monit

当我运行监视日志文件时,它显示错误。

[EDT Jun 18 09:50:11] error    : 'sidekiq_site' process is not running
[EDT Jun 18 09:50:11] info     : 'sidekiq_site' trying to restart
[EDT Jun 18 09:50:11] info     : 'sidekiq_site' start: /bin/bash
[EDT Jun 18 09:51:41] error    : 'sidekiq_site' failed to start

/etc/monit/conf.d/sidekiq.conf

check process sidekiq_site
  with pidfile /var/www/project/shared/pids/sidekiq.pid
  start program = "bash -c 'cd /var/www/project/current ; RAILS_ENV=production bundle exec sidekiq --index 0 --pidfile /var/www/project/shared/pids/sidekiq.pid --environment production --logfile /var/www/project/shared/log/sidekiq.log --daemon'" as uid root and gid root with timeout 90 seconds
  stop program = "bash -c 'if [ -d /var/www/project/current ] && [ -f /var/www/project/shared/pids/sidekiq.pid ] && kill -0 `cat /var/www/project/shared/pids/sidekiq.pid`> /dev/null 2>&1; then cd /var/www/project/current && bundle exec sidekiqctl stop /var/www/project/shared/pids/sidekiq.pid 1 ; else echo 'Sidekiq is not running'; fi'" as uid root and gid root
  if totalmem is greater than 200 MB for 2 cycles then restart # eating up memory?
  group site_sidekiq

/ etc / monit / monitrc

set daemon 30

set logfile /var/log/monit.log
set idfile /var/lib/monit/id
set statefile /var/lib/monit/state

set eventqueue
    basedir /var/lib/monit/events
    slots 100



set httpd port 2812
   allow admin:""
set httpd port 2812 and
    use address xx.xxx.xx.xx
    allow xx.xx.xx.xx

check system trrm_server
  if loadavg(5min) > 2 for 2 cycles then alert
  if memory > 75% for 2 cycles then alert
  if cpu(user) > 75% for 2 cycles then alert

include /etc/monit/conf.d/*

在monit中运行启动/停止事件时,没有设置路径变量,因此所有程序都必须具有绝对路径,即使您对bash的调用也是如此。

Monit不使用任何环境变量

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM