I'm considering implementing EC2's Elastic Load Balancing features, but I'm running a web application (on the LAMP stack) that has frequent changes and wondering what the most common strategy is for keeping the application in sync between the servers that are load balanced. The database would live elsewhere, so I'm only worried (at this point) about keeping the actual scripts in sync when I make changes.
Asked
Active
Viewed 4,126 times
4
-
I'm also having this issue :( – CodeGuru Feb 08 '13 at 04:00
3 Answers
5
It depends how frequently you're going to update the scripts:
- The most common solution is to store your shared components in an EBS volume, create a snapshot and then mount that from the instances - either as the root device (allowing you to keep the entire code state in sync across all instances) or as a secondary volume (containing just your code, allowing you to use AMIs built by other users, like Canonical)
- With frequent updates a simple solution like rsync is likely the winner, alternatively you could keep them on S3 and use the S3 fuse module to mount the scripts directly from S3 (with this solution you may end up spending slightly more on the number of S3 GET requests depending on how S3 fuse caches).

Peter
- 965
- 7
- 13
2
The one way of addressing this problem is using a continuous integration which can transfer your files with rsync
and build the project on the servers, this is not just yet.
There are quite a bunch of plugins available (PHPUnit, Code Coverage, Code Analysis, etc):
How:
- Install Jenkins
- Configure your project (probably you code should be in some code-version-system) with Jenkins
- Configure the servers, project-path, pre-job, post-job, etc.
- Schedule the work/job.
- That's it, done.
Reference:

Rakesh Sankar
- 9,337
- 4
- 41
- 66
0
You can run Chef/Puppet on AWS Infra. Have this integrated to Git/SVN. New changes will be automatically picked up by Chef from SVN and moved into your Amazon EC2 web servers periodically.

Harish Ganesan
- 743
- 5
- 4