ruby-on-rails - Monit 无法重启 sidekiq

标签 ruby-on-rails centos sidekiq monit

我正在尝试让监视器在 CentOS 服务器上重新启动我的 sidekiq 服务。在尝试了多种解决方案后,我很困惑,仍然无法启动该服务。

我来自 monit.d 的 sidekiq 文件:

check process sidekiq
  with pidfile /var/www/App/tmp/pids/sidekiq.pid
  start program = "/bin/bash -l -c 'sudo cd /var/www/App && bundle exec sidekiq --index 0 --pidfile /var/www/App/tmp/pids/sidekiq.pid --environment production --logfile /var/www/App/log/sidekiq.log --daemon'" as uid deploy and gid deploy
  stop program = "/bin/bash -l -c 'cd /var/www/App && bundle exec sidekiqctl stop /var/www/App/tmp/pids/sidekiq.pid 10'" as uid deploy and gid deploy
  if totalmem is greater than 512 MB for 2 cycles then restart
  if 3 restarts within 5 cycles then timeout

如果我手动运行启动程序命令,它会正常启动 sidekiq,但 monit 似乎什么也没做。刚想出:

[BST Oct  6 11:51:17] error    : 'sidekiq' process is not running
[BST Oct  6 11:51:17] info     : 'sidekiq' trying to restart
[BST Oct  6 11:51:17] info     : 'sidekiq' start: /bin/bash
[BST Oct  6 11:52:47] error    : 'sidekiq' failed to start

因此它可以很好地包含文件,但不知何故无法从脚本启动服务。

它可以是什么?某种权限问题?

最佳答案

您需要更新到最新的 Monit 版本 (5.14)。 删除当前的监视器安装并按照以下说明操作:

https://rtcamp.com/tutorials/monitoring/monit/

希望对您有所帮助!

PS:在这里找到解决方案:https://bitbucket.org/tildeslash/monit/issues/109/failed-to-stop-always-after-60-seconds

关于ruby-on-rails - Monit 无法重启 sidekiq,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32968215/

相关文章:

javascript - 在 ember.js 中保存对象时出错 : 'Object X has no method ' save''

ruby-on-rails - ruby 一行 "check value and return"

linux - 在 Linux 上为特定端口配置代理

linux - 在启动时设置进程-非root用户

devise - Sidekiq Web 因 nil :NilClass 导致未定义方法 `failure_app' 失败

ruby-on-rails - Ruby:什么会导致同一代码块的执行在一遍又一遍地运行时随着时间的推移而变慢?

ruby-on-rails - Rails + Carrierwave : How to change default file naming of image versions (thumb, 小等)?

linux - 查找哪个java程序被Linux OOM Killer杀死

ruby-on-rails - 从 IDE 运行 rake 任务时出错