I'm currently deploying a small C# console application to 200 Amazon EC2 instances. Whenever the code gets updated, what I'm now doing is terminate all the instances, compile the code and copy the executable file to the previous AMI image and then create 200 instances again from the new AMI images. I think this is indeed very inefficient and I want to find a better way of doing it. How can I deploy the application to these EC2 instances quickly?
-
1Why are you re-creating the image? You need to write an update program or a "smart client" that will always grab the latest version of the application from a master server. – tier1 Nov 01 '12 at 19:53
2 Answers
You may want to look into using a Platform-as-a-Service solution. A PaaS would allow you to submit the compiled application to the PaaS and let it start the machines and set your code up on them. A PaaS would also give you additional features like monitoring, cross-cloud support and updating the application on the fly.
There are a several PaaS vendors mentioned here: Looking for PaaS providers recommendations
Disclaimer: I work for Cloudify, an open-source PaaS.
You could optimize the process as follows when you release a new version: compile your app and copy it somewhere on a a running instance (the reference). From that reference, deploy the app to all your running instances using only cheap internal bandwidth. You can automate this procedure using a deployment tool which you would install on your reference instance. Kwatee, for instance (I'm the author), is a free tool that is lightweight and easy to configure with a web interface that has specific features for EC2. To use it on windows environments you will need to setup your target instances with an sshd server which you'd just need to configure once in your AMI

- 5,627
- 1
- 18
- 21