我无法弄清楚如何让上帝重新启动resque。上帝resque开始给“服务器不可用”
我在Ubuntu 10.04.3 LTS Linode切片上安装了Rails 3.2.2堆栈。它的运行系统是Ruby 1.9.3-p194(没有RVM)。
有在/etc/init.d/god-service
包含神的init.d服务:
master.conf
在上面包含:
load "/var/www/myapp.com/current/config/resque.god"
resque.god
在上面包含:
APP_ROOT = "/var/www/myapp.com/current"
God.log_file = "/var/www/myapp.com/shared/log/god.log"
God.watch do |w|
w.name = 'resque'
w.interval = 30.seconds
w.dir = File.expand_path(File.join(File.dirname(__FILE__),'..'))
w.start = "RAILS_ENV=production bundle exec rake resque:work QUEUE=*"
w.uid = "deploy"
w.gid = "deploy"
w.start_grace = 10.seconds
w.log = File.expand_path(File.join(File.dirname(__FILE__), '..','log','resque-worker.log'))
# restart if memory gets too high
w.transition(:up, :restart) do |on|
on.condition(:memory_usage) do |c|
c.above = 200.megabytes
c.times = 2
end
end
# determine the state on startup
w.transition(:init, { true => :up, false => :start }) do |on|
on.condition(:process_running) do |c|
c.running = true
end
end
# determine when process has finished starting
w.transition([:start, :restart], :up) do |on|
on.condition(:process_running) do |c|
c.running = true
c.interval = 5.seconds
end
# failsafe
on.condition(:tries) do |c|
c.times = 5
c.transition = :start
c.interval = 5.seconds
end
end
# start if process is not running
w.transition(:up, :start) do |on|
on.condition(:process_running) do |c|
c.running = false
end
end
end
在deploy.rb
我有一个reload tas K:
task :reload_god_config do
run "god stop resque"
run "god load #{File.join(deploy_to, 'current', 'config', 'resque.god')}"
run "god start resque"
end
的问题是我是否部署或手动运行god (stop|start|restart|status) resque
,我得到错误信息:
The server is not available (or you do not have permissions to access it)
我尝试安装god
系统宝石和指向它在god-service
:
GOD_BIN=/usr/local/bin/god
但是god start rescue
给出了相同的错误。
sudo /etc/init.d/god-service start
所以它可能是一个权限问题,我认为,可能与该init.d中服务由root
神拥有的事实运行:
不过,我可以做启动服务来自deploy
用户的捆绑包。
解决此问题的最佳方法是什么?
我有同样的问题。你能解决它吗? – haider
不幸的是,我现在只是在没有上帝的情况下运行我的服务。当我有机会时,我会看看Bluepill。 –
同样的问题任何人都找到了解决方案? – Rubytastic