tags:

views:

59

answers:

3

We are about to outgrow our web server and will deploy the homepage on two load balanced web servers. We currently have a working copy checked out, and whenever (daily) we change anything we svn update the copy. The problem of running on two servers is of course the increased chance of not complete updates on either server leading to strange behaviour.

We also have a separate web server for internal use, and a separate database server. The question is how, if possible, to run one command (probably on the admin server) to update both working copies?

We use subversion over SSH.

+1  A: 

Here's what we do:

The path to our rails-app contains a symbolic link. When updating our app we completely check out the repo on all the servers to a new location and run the unit tests. When all update-processes have successfully finished their job, we update the symbolic link - almost simultaneously.

Check out http://www.capify.org for a deployment-strategy of this kind

flitzwald
A: 

brute force,,,

why not having a script on your server like:

svn up /var/html/myapp
ssh user@host2 'svn up /var/html/myapp'

then everyone (or the project manager) has to execute this script (remotely) to update the production servers.

But I am sure that there are more elegant solutions out there

Vladimir
A: 

Just have the server working directory symlinked to a common location that both servers point to. You only have 1 working copy and both servers point to it. Then you only have to update 1 location.

KOGI
Not really going to be load balanced then, at least not at fs level
Zac Thompson
Not at the filesystem level, no. But the web server load will still be balanced.
KOGI