Using capistrano with a load balancer

960 views Asked by At

We have a site on Rackspace with 2 servers and a load balancer, deployed with Capistrano (actually Capifony). I would like to:

  1. Disable server 1 on the load balancer
  2. Upgrade server 1 to the new code
  3. Pause and let me test server 1 by logging in to it's IP address
  4. Reenable server 1; Disable server 2 on the load balancer (users will now get the new version of the site)
  5. Upgrade server 2 to the new code
  6. Pause and let me test server 2
  7. Reenable server 2 on the load balancer.

The database is hosted elsewhere and is not affected by this upgrade.

Capistrano seems very good at deploying to multiple servers at once (although I'd like to see an answer to this question), but it's not clear how to do the above. It seems like a safe way to do an upgrade in what is a pretty common scenario.

I guess if I add rules to do the load balancer, I might be able to use this answer to make the deployments run consecutively, not all at once.

An option that would be nice is if capistrano could do all of the deployment, but not change the current symlink on both servers. Then I could manually do the load balancing and update the symlinks myself.

This question is similar, but the answer given won't work with PHP as there is no need to restart the server - the new code will start executing as soon as you upload it.

0

There are 0 answers