Question

I'm new to AWS. Can anyone point me in the right direction of how to update my app residing on multiple ec2 instances?

I found this answer: How do I update multiple EC2 instances that are load-balanced? which points to this article: http://linuxforlovers.wordpress.com/2009/04/11/sharing-amazon-elastic-block-store-among-multiple-instances/ The article has been updated and explains you can boot from EBS-backed AMIs that can have essentially unbounded size as of now.

Does this mean instead of having a ebs instance that I can update with my app, I can load the app on an ec2 instance, create an ami saved to an ebs volume, then boot from EBS-backed ami?

Does this mean I set my launch configuration to ebs volume with the ami as opposed to just an ami?

In essence my question is, how do I update my app that is running on multiple ec2 instances without logging into each machine and changing the app?

Thanks!

Was it helpful?

Solution 2

I think the way to accomplish this is to create a new ami with each new piece of software rolled out. You then build a new launch config for each ami. You then update your scaling group with the new launch config.

OTHER TIPS

Netflix uses the approach you describe, where every new app release gets it's own AMI created, then they use their open source Asgard software to do rolling restarts, terminating old instances and spawning new instances running the new AMI.

That is a completely valid way to work, but for most of my work that's overkill. The building and management of AMI's is often more of a hassle than simply putting new software on the servers. I mostly use capistrano to automate code launches (which mostly involve doing a git pull) and restarting webservers, and I use chef for changes to server configurations and third-party software installs. If a systems change is involved enough, I'll burn a new AMI and restart using that.

So I think it depends on which aspects of your workflow are creating bottlenecks. If it's just deployment automation, check out capistrano and chef. If updating your app involves a lot of friction and deployment hassles, AMI's may be a good way to go. Either way, I always make sure my chef recipes can build the server to any particular software version spec. Hope this helps.

You can use AWS CodeDeploy to update your app on multiple EC2. It minimize downtime by progressively working across the instances and allowing applications to remain available and continue serving traffic..

You can also track deployments, stop, make rollbacks.. and it's free if your app is running on EC2.

Now that OpsWorks has been released the scene has shifted a bit. Have a look at that, as its an Amazon supported means of doing what you want - might be overkill for your needs though.

Check out capistrano, a deployment tool written in Ruby to solve exactly the problem you describe.

While it is a Ruby tool, it can be used to deploy applications that are not Ruby.

It manages the simultaneous SSH'ing into multiple servers, updates the code, and performs deployment tasks that are tailored to the role of each server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top