我似乎无法让Capistrano与AmazonRDS良好地配合。我已经找遍了各地的任何信息正确设置,但没有找到任何。现在,当我cap deploy
,过程超时。Capistrano在使用Amazon RDS部署时超时
这是我deploy.rb:
set :deploy_to, "/opt/bitnami/apps/annarbortshirtcompany.com/cms/"
set :scm, :git
set :repository, "ssh://[email protected]/~/repo/cms.git"
set :deploy_via, :remote_cache
set :user, "user"
ssh_options[:keys] = [File.join(ENV["HOME"], "EC2", "admin.pem")]
ssh_options[:forward_agent] = true
set :branch, "master"
set :use_sudo, true
set :location, "ec2-webserver.compute-1.amazonaws.com"
role :web, location
role :app, location
role :db, "cmsinstance.c7r8frl6npxn.us-east-1.rds.amazonaws.com", :primary => true
# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
task :start do ; end
task :stop do ; end
task :restart, :roles => :app, :except => { :no_release => true } do
run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
end
end
的RDS数据库实例的用户名不同于SSH用户名在这里设置,但在我的database.yml定义。我认为这可能不是由capistrano读取的,但不知道如何做到这一点。
当我的“帽子部署”:
[email protected]:~/RailsApps/cms$ cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote ssh://[email protected]/~/repo/cms.git master"
command finished in 1590ms
* executing "if [ -d /app-directory/shared/cached-copy ]; then cd /app-directory/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard ffc4ec7762566f801c4a9140aa3980dc71e3d06f && git clean -q -d -x -f; else git clone -q ssh://[email protected]/~/repo/cms.git /app-directory/shared/cached-copy && cd /app-directory/shared/cached-copy && git checkout -q -b deploy ffc4ec7762566f801c4a9140aa3980dc71e3d06f; fi"
servers: ["ec2-webserver.compute-1.amazonaws.com", "dbinstance.us-east1.rds.amazonaws.com"]
*** [deploy:update_code] rolling back
* executing "rm -rf /app-directory/releases/20110607161612; true"
servers: ["ec2-webserver.compute-1.amazonaws.com", "dbinstance.us-east1.rds.amazonaws.com"]
** [deploy:update_code] exception while rolling back: Capistrano::ConnectionError, connection failed for: dbinstance.us-east1.rds.amazonaws.com (Errno::ETIMEDOUT: Connection timed out - connect(2))
connection failed for: dbinstance.us-east1.rds.amazonaws.com (Errno::ETIMEDOUT: Connection timed out - connect(2))
它为什么要“更新所有服务器上的缓存结账”?现在甚至不需要数据库服务器。我很难理解如何解决这个问题。希望有人能指出我正确的方向!
澄清,一切都指向数据库'时的伟大工程:location'代替RDS实例 – 2011-06-07 18:11:53