D-N*_*ice 3 capistrano ruby-on-rails unicorn
如果我想在部署后手动停止并启动独角兽,那么该应用程序可以正常部署.但是,我想使用零停机时间独角兽设置,但它无法正常工作,因为启动的新独角兽进程正在查看旧的部署版本路径.在deploy.rb中没有什么特别的,简单的重新启动:
desc "Zero-downtime restart of Unicorn"
task :restart, :except => { :no_release => true } do
run "cd #{current_path}; #{try_sudo} kill -s USR2 `cat /var/www/appname/shared/pids/unicorn.pid`"
end
Run Code Online (Sandbox Code Playgroud)
我知道它正在查看错误的目录,因为如果视图没有更改,并且如果我设置keep_releases为1或2,则unicorn日志将显示错误,因为它尝试启动的目录已被删除:
/var/www/appname/shared/bundle/ruby/1.9.1/gems/unicorn-4.4.0/lib/unicorn/http_server.rb:425:in `chdir': No such file or directory - /var/www/appname/releases/20130330104246 (Errno::ENOENT)
Run Code Online (Sandbox Code Playgroud)
我一直试图打开和关闭这几个星期.任何帮助这项工作非常感谢!
启动独角兽时设置此环境变量
BUNDLE_GEMFILE=$APP_PATH/current/Gemfile
Run Code Online (Sandbox Code Playgroud)
否则它将指向特定的发布目录,这将导致您描述的行为.
例如.
cd $APP_PATH/current && BUNDLE_GEMFILE=$APP_PATH/current/Gemfile bundle exec unicorn_rails -c $APP_PATH/current/config/unicorn.rb -E $RAILS_ENV -D
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
970 次 |
| 最近记录: |