Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Currently I have 4 EC2 instances in amazon cloud behind a load balancer and this number will grow up to 20-30. I am looking for the best way to manage source code on all of these instances. There is a http server + php running on all instances.

What I need is a way to update the source code on all of the instances simultaneously. After some research I think I've found a solution - create a NFS server and export the directory with source code to all instances. Every instance will mount this exported directory and use it as document root for apache http server.

Is this approach correct or do you suggest anything else? Is NFS capable of sharing the source code to all EC2 nodes simultaneously?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

NFS can certainly be used for this, but by doing it this way, you're setting yourself up a farily significant single point of failure. If the NFS server goes down, you're screwed. Additionally, disk IO performance will suffer when using NFS due the extra hop over the network that is required with NFS.

Instead, I'd recommend looking into a deployment tool like Fabric or Capistrano. Either of these can get code pushed out to your servers very quickly. If you're worried about some of the servers being "out of step" temporarily during deployment, then you ought to have your LB pull that server out of rotation before new code is deployed, then re-added to the rotation after successful deployment.

Addendum: "Simultaneous deployment" is a pipe dream. Just forget about that. It's difficult enough with a few servers, let alone tens or hundreds.

share|improve this answer
    
Thank you ErikA, I had some doubts about using NFS, I am going to try Fabric, looks good ; ) –  Michal Jajcaj May 30 '12 at 9:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.