Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 3rd, 2012  |  syntax: None  |  size: 1.06 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Just a few steps in order to autoscale your application...
  2.  
  3. In this example an autoscaling policy was created for www.altaconfidelidad.com "alta"
  4.  
  5. Current infrastructure for alta contains:
  6. 1 micro ec2 instance
  7. 1 load balancer
  8. 1 EBS volume attached for persistant storage
  9.  
  10. Requirements:
  11. Amazon EC2 cli tools
  12. Amazon AS cli tools
  13.  
  14. Step 1.  Launch Config
  15.  
  16. as-create-launch-config <launch-config-name> --image-id <snap-ami-id> --instance-type m1.large --block-device-mapping '/dev/sdf=<snap-vol-id>:true' --region us-east-1 --group <sec-group>
  17.  
  18. Step 2. Autoscale Group
  19.  
  20. as-create-auto-scaling-group <group-name> --launch-configuration <launch-config-name> --availability-zones us-east-1b --min-size 0 --max-size 2 --load-balancers <loadbalancer-name> --region us-east-1
  21.  
  22. Step 3. Scaling Policies
  23.  
  24. as-put-scaling-policy <policy-name-up> --auto-scaling-group <group-name> --adjustment=1 --type ChangeInCapacity --cooldown 300 --region us-east-1
  25.  
  26. as-put-scaling-policy <policy-name-down> --auto-scaling-group <group-name> --adjustment=-1 --type ChangeInCapacity --cooldown 300 --region us-east-1