Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sync my EC2 instance when autoscaling

When autoscaling my EC2 instances for application, what is the best way to keep every instances in sync?

For example, there are custom settings and application files like below...

  • Apache httpd.conf
  • php.ini
  • PHP source for my application

To get my autoscaling working, all of these must be configured same in each EC2 instances, and I want to know the best practice to sync these elements.

like image 325
tomodian Avatar asked Nov 21 '10 17:11

tomodian


1 Answers

You could use a private AMI which contains scripts that install software or checkout the code from SVN, etc.. The second possibility to use a deployment framework like chef or puppet.

The way this works with Amazon EC2 is that you can pass user-data to each instance -- generally a script of some sort to run commands, e.g. for bootstrapping. As far as I can see CreateLaunchConfiguration allows you to define that as well.

If running this yourself is too much of an obstacle, I'd recommend a service like:

  • scalarium
  • rightscale
  • scalr (also opensource)

They all offer some form of scaling.

HTH

like image 164
Till Avatar answered Oct 13 '22 13:10

Till