我正在尝试让bluepill来监控我的优秀员工。
如果我以root用户身份从rails root运行此命令,它将启动resque worker ok。
cd /var/www/domain.com/current; RAILS_ENV=production QUEUE=* bundle exec rake resque:work但是当我尝试使用bluepill运行它时,它只是一直试图启动它,并且没有给我一个错误。
这是我的bluepill日志,显示它正在尝试...!
W, [2011-07-12T22:58:21.640467 #19267] WARN -- : [domain.com:resque] Executing start command: cd /var/www/domain.com/current; RAILS_ENV=production QUEUE=* bundle exec rake resque:work
I, [2011-07-12T22:58:21.754392 #19267] INFO -- : [domain.com:resque] Going from down => starting
I, [2011-07-12T22:59:21.334300 #19267] INFO -- : [domain.com:resque] Going from starting => down
W, [2011-07-12T22:59:22.339873 #19267] WARN -- : [domain.com:resque] Executing start command: cd /var/www/domain.com/current; RAILS_ENV=production QUEUE=* bundle exec rake resque:work
I, [2011-07-12T22:59:22.479740 #19267] INFO -- : [domain.com:resque] Going from down => starting它一直在一次又一次地这样做。
下面是我的.pill文件进程
app.process("resque") do |process|
process.start_command = "cd #{RAILS_ROOT}; RAILS_ENV=#{RAILS_ENV} QUEUE=* bundle exec rake resque:work"
process.daemonize = true
process.start_grace_time = 10.seconds
process.stop_grace_time = 10.seconds
process.restart_grace_time = 10.seconds
end我已经尝试延长开始宽限时间,如果它没有在所需的时间内加载,但不会有什么不同。
有谁能帮上忙吗?
先谢谢你,里克
发布于 2011-07-14 11:18:42
不适合使用bundle exec (有点旧),但可以很容易地进行编辑。
这是我的生产环境Bluepill AudioBox.fm配置,经过实战测试,乐于分享。
ENVIRONMENT = 'production'
RAILS_ROOT = ENV['RAILS_ROOT'] || "/var/www/myapp/current"
Bluepill.application("myapp", :log_file => "/var/log/bluepill.log") do |app|
app.uid = "ubuntu"
app.gid = "ubuntu"
4.times do |i|
app.process("uploaders-#{i}") do |process|
process.working_dir = RAILS_ROOT
process.group = "resque"
queues = "amazon_upload"
process.start_command = "/usr/bin/env VERBOSE=true RAILS_ENV=#{ENVIRONMENT} QUEUE=#{queues} rake resque:work --trace"
process.stop_command = <<-EOF
kill -QUIT {{PID}}
sleep_count=0
while [ -e /proc/{{PID}} ]; do
sleep 1
let "sleep_count+=1"
if [ $sleep_count -eq 60 ]; then
kill -TERM {{PID}}
fi
if [ $sleep_count -ge 70 ]; then
kill -KILL {{PID}}
fi
done
EOF
process.stdout = process.stderr = "#{RAILS_ROOT}/log/resque.log"
process.pid_file = "#{RAILS_ROOT}/tmp/pids/resque-uploader-#{i}.pid"
process.daemonize = true
process.start_grace_time = 5.seconds
process.stop_grace_time = 75.seconds
process.restart_grace_time = 80.seconds
process.checks :mem_usage, :below => 350.megabytes, :every => 1.minute, :times => 3
end
end
end发布于 2012-02-21 11:15:57
@kain的答案解决你的问题了吗?我也有一些非常类似的事情刚刚开始发生,请参见bluepill not detecting that processes have, in fact, started successfully, and so creates new ones
发布于 2012-02-25 02:14:50
你没有说你使用的是什么版本的bluepill,但我只是修复了一个bug,这个bug恰好体现了这种行为。Pull request submitted。
https://stackoverflow.com/questions/6671827
复制相似问题