amazon ec2 - How to replace ECS cluster instances without downtime or reduced redundancy? -


i have try-out environment ~16 services divided on 4 micro-instances. instances managed autoscaling group (asg). when need update ami of cluster instances, do:

  1. create new launch config, edit asg new launch config.
  2. detach instances replacement option asg , wait until new ones listed in cluster instance list.
  3. manually find , deregister old instances ecs cluster (very tricky)
  4. now services killed ecs due deregistering instances :(
  5. wait 3 minutes until services restarted on new instances
  6. manually find ec2 instances in ec2 instance list , terminate them (be very careful not terminate new ones).

with approach have 3 minutes of downtime , shiver idea in production envs.. there way without downtime keeping overall amount of instance same (so without 200% scaling settings etc.).

you can update launch configuration new ami , assign asg. make sure include following in user-data section:

echo ecs_cluster=your_cluster_name >> /etc/ecs/ecs.config 

then terminate 1 instance @ time, , wait until new 1 , automatically registered before terminating next.

this scriptable automated too.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -