Load balancing web servers + keeping content synced

狂风中的少年 提交于 2019-12-05 12:13:01

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

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!