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.

Ok this may seem like kind of a newbie question, but here goes.

I'm using Amazon Web Services and created a Elastic Load Balancer for 2 instances that are identical EBS EC2 instances. We'll call these Server A and Server B. When a request for a file on the main load balancer, I'm assuming it balances the load between and pulls the file from either Server A or Server B. Now if I want to make a change to one of the site files on Server A. Do I then have to make the same change to Server B's file?

share|improve this question
add comment

2 Answers

Yes, the content on both servers needs to be the same for the sites served through the ELB, otherwise you'll end up with different content being delivered.

share|improve this answer
    
Is there any other options. Anyway to sync, that's easier than doing a new snapshot, re-deploying, and re-mapping instances to the load balancer? –  nuecaster Jul 19 '11 at 0:36
    
Sure, you can load your code at instance boot using a deployment or configuration management system, or put your app assets on S3. –  womble Jul 19 '11 at 0:39
add comment

You do need the same files on both. One way to achieve that is to use a cluster file system, such as gluster - you can mount the file system, and it will automatically replicate changes between the servers (or if you grow to more servers, you can setup a distributed file system so that you don't end up with too many copies of the same file).

I believe that another approach is possible, but it would largely negate the point of a load balancer. In some reverse proxies it should be possible to setup a redirect if a file doesn't exist, where the redirect points at another server. So, essentially, check for file - serve if exists, otherwise, use the other server. Frankly, I see no point to this approach, in this scenario.

share|improve this answer
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.