0

Say I've got a PHP site on an ec2 instance in an autoscale group. The group has 10 running instances. I want to add some new php code to the site. Is there a sane way to do this and have it populate to all other instances in the autoscaling group?

The only way I can see is to manually bundle an image from the instance, upload it to S3, register the bundle with aws and attach the bundle to the launch config of the autoscale group. I then have to terminate all my instances and launch new ones with the new image.

I would have to do all this every time I want to make a change to the codebase. Surely this is madness.

waigani
  • 3,570
  • 5
  • 46
  • 71

1 Answers1

1

The best way is NOT to bundle your page into the image. Make the ami download them from s3 on start. In this way you can upload to only one place and call the download script.

J-16 SDiZ
  • 26,473
  • 4
  • 65
  • 84
  • This would slow the launch time down though right? Also, would I need to use something like Puppet to orchestrate the download or is there a more light weight solution? Maybe using git could work? – waigani Jun 19 '12 at 08:42
  • s3 to ec2 is fast. of course you can use git or other sync solution, but then you need a separate git server (git on s3 is dumb transport). I don't think this worth the effort, but this depends on how often you make change, size and the likes .... – J-16 SDiZ Jun 19 '12 at 09:00
  • How do you handle system configs? e.g. making a change to php.ini – waigani Jun 19 '12 at 21:30
  • Also, what about setting up an s3fs mount on startup? Do you know of any cons in using an s3fs mount (http://code.google.com/p/s3fs/wiki/FuseOverAmazon)? – waigani Jun 19 '12 at 21:39
  • 1
    looks like s3fs is slow and cannot read preexisting dirs. s3cmd looks like the way to go. I will bundel a new image if I need to do system configs (e.g. php.ini), which should not be very often. – waigani Jun 20 '12 at 01:39