1

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?

2 Answers 2

1

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.

2
  • 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, 2011 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, 2011 at 0:39
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .