我在试着给Sidekiq设置Monit到目前为止,我的配置文件如下所示:
check process sidekiq_site
with pidfile /var/www/site/tmp/pids/sidekiq.pid
start program = "bundle exec sidekiq -C /var/www/site/config/sidekiq.yml -P /var/www/site/tmp/pids/sidekiq.pid" with timeout 90 seconds
if totalmem is greater than 200 MB for 2 cycles then restart # eating up memory?
group site_sidekiq问题是,当我运行monit reload时,我收到一条消息,告诉我程序"bundle“不存在。
有人有解决这个问题的办法吗?
发布于 2013-08-09 09:35:40
在完成了我自己的monit和sidekiq配置之后,我可以分享我在运行ubuntu时的工作原理。
首先,如果你使用的是ubuntu发行版,那么这里有一个适用于ubuntu的sidekiq upstart脚本。有一些用于sidekiq和管理工作人员的脚本:https://github.com/mperham/sidekiq/tree/master/examples/upstart/manage-one
在使用rvm时,我在使用默认的upstart脚本时遇到了一些错误。检查/var/logs/upstart/sidekiq 0.log揭示了一些问题。这一行:
exec bin/sidekiq -i ${index} -e production -C config/sidekiq.yml -P tmp/pids/sidekiq-${index}.pid
需要更改为exec bundle exec sidekiq +选项
然后,为了使所有内容与我的rvm安装保持一致,我更改了以下内容:
#source $HOME/.rvm/scripts/rvm
source /usr/local/rvm/scripts/rvmetc/monit/monitrc中的我引用了upstart脚本并拥有:
# sidekiq
check process sidekiq
with pidfile /var/www/apps/myapp/current/tmp/pids/sidekiq-0.pid
start program = "/usr/bin/sudo start sidekiq index=0"
stop program = "/usr/bin/sudo stop sidekiq index=0"
if totalmem is greater than 500 MB for 2 cycles then restart # eating up memory?
if 3 restarts within 5 cycles then timeout发布于 2012-11-29 16:27:26
检查这个:https://groups.google.com/forum/?fromgroups=#!topic/rubyversionmanager/0abB9jlqi_Y如果你使用rvm,
/bin/su - <username> -c 'bundle exec sidekiq -C /var/www/site/config/sidekiq.yml -P /var/www/site/tmp/pids/sidekiq.pid'如果你从用户启动monit,在你的.bash_profile中设置$HOME。
发布于 2013-05-05 00:36:43
这是我在github上写的要点:
check process sidekiq_production with pidfile /var/run/sidekiq_production.pid
depends on redis-server
start program = "/etc/init.d/sidekiq_production start" with timeout 90 seconds
stop program = "/etc/init.d/sidekiq_production stop" with timeout 90 seconds
if totalmem is greater than 200 MB for 2 cycles then restart # eating up memory?
if 2 restarts within 3 cycles then timeout我还在Debian上为sidekiq写了一个初始化脚本:https://gist.github.com/alain75007/5517948
https://stackoverflow.com/questions/13433866
复制相似问题