Load balancing web servers + keeping content synced Load balancing web servers + keeping content synced apache apache

Load balancing web servers + keeping content synced


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).


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):

Jenkins

How:

  1. Install Jenkins
  2. Configure your project (probably you code should be in some code-version-system) with Jenkins
    1. Configure the servers, project-path, pre-job, post-job, etc.
  3. Schedule the work/job.
  4. That's it, done.

Reference:

  1. Configuration:
    1. configuring - ex.1
    2. Initial configuration
      1. Configuring the jobs
  2. http://agile.dzone.com/news/continuous-integration-php


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.