AWS EC2 Autoscaling: Define a Master Instance That Never Stops

I am using EC2 with autoscaling and load balancing to host my webapp. To ensure consistency across EC2 instances, I only want to allow access to the admin interface from one instance, so all write operations are done on that instance. Other instances then periodically download copies of the modified files.

So here's my question:

Can I have an assigned instance of "Master" in my autoscale group that is slightly different (a script is executed to load the files that were written)? Of course, this Instance should never be closed, no matter what. All other "slave" instances are indentical, which can be created and terminated on demand. Is there some kind of configuration option for this or can I do it through policy?

+3


source to share


1 answer


My suggestion would be one of two things, either two autosave groups - one for read-only instances (i.e. non-master) and then another ASG for the main instance (s). Even if there is only one master instance at any time, you can still take advantage of including it in your own autoscale group, taking advantage of the ASG's ability to detect when it has failed and create one new instance to replace it.



Alternatively, remove the primary instance from autoscaling entirely and just run it as reserved instances - let the rest of the RO instances scale up and down as needed.

+5


source







All Articles