The Leading Cloud Operations Optimization Service
US Toll Free(800) 505-9638
  • CUSTOMERS
  • BLOG
  • CONTACT
  • LOGIN
  • SIGN UP
  • CUSTOMERS
  • BLOG
  • CONTACT
  • LOGIN
  • SIGN UP
  • CUSTOMERS
  • BLOG
  • CONTACT
  • LOGIN
  • SIGN UP
  • AWS RESELLERS
  • SOLUTIONS
    • Newvem for AWS
      • How it Works
      • Utilization Heat Map
      • Business Views of AWS
      • Cloud Baseline
        • Assets
        • Costs
        • Risks
      • AWS Support
        • Support Center
        • Community Forums
        • Knowledge Center
          • How-to Guides
          • Community Articles
          • Amazon Cloud Computing Services
          • AWS Cloud Support
          • AWS Reserved Instances
          • AWS Console
          • AWS EC2
          • Amazon Elastic Compute Cloud
          • EC2 Instances
          • Understanding Amazon AMI
        • Proficiency Level
          • Beginner
          • Advanced
          • Professional
        • Cloud Partners
        • Cloud Experts
      • Cloud Insight by Topic
        • Capacity
        • Utilization
        • Availability
        • Security
        • Financial Efficiency
      • Advanced Analytic Tools
        • Baseline Insights
        • Premium Insights
        • Business Groups
        • Reserved Instances
        • S3 Analytics
      • Cloud Baseline by Role
        • C-Level Cockpit
        • IT Managers View
        • Operators View
        • Developers View
      • Cloud Insight by AWS Service
        • Amazon EC2
        • Amazon S3
      • iPhone / iPad App
    • Newvem for Azure
      • Azure Beta Program
      • Knowledge Center
  • FEATURES
    • Free Cloud Care Features
    • Premium Cloud Care Features
  • PRICING
  • AZURE BETA
  • AWS RESELLERS
  • SOLUTIONS
    • Newvem for AWS
      • How it Works
      • Utilization Heat Map
      • Business Views of AWS
      • Cloud Baseline
        • Assets
        • Costs
        • Risks
      • AWS Support
        • Support Center
        • Community Forums
        • Knowledge Center
          • How-to Guides
          • Community Articles
          • Amazon Cloud Computing Services
          • AWS Cloud Support
          • AWS Reserved Instances
          • AWS Console
          • AWS EC2
          • Amazon Elastic Compute Cloud
          • EC2 Instances
          • Understanding Amazon AMI
        • Proficiency Level
          • Beginner
          • Advanced
          • Professional
        • Cloud Partners
        • Cloud Experts
      • Cloud Insight by Topic
        • Capacity
        • Utilization
        • Availability
        • Security
        • Financial Efficiency
      • Advanced Analytic Tools
        • Baseline Insights
        • Premium Insights
        • Business Groups
        • Reserved Instances
        • S3 Analytics
      • Cloud Baseline by Role
        • C-Level Cockpit
        • IT Managers View
        • Operators View
        • Developers View
      • Cloud Insight by AWS Service
        • Amazon EC2
        • Amazon S3
      • iPhone / iPad App
    • Newvem for Azure
      • Azure Beta Program
      • Knowledge Center
  • FEATURES
    • Free Cloud Care Features
    • Premium Cloud Care Features
  • PRICING
  • AZURE BETA
  • AWS RESELLERS
  • SOLUTIONS
    • Newvem for AWS
      • How it Works
      • Utilization Heat Map
      • Business Views of AWS
      • Cloud Baseline
        • Assets
        • Costs
        • Risks
      • AWS Support
        • Support Center
        • Community Forums
        • Knowledge Center
          • How-to Guides
          • Community Articles
          • Amazon Cloud Computing Services
          • AWS Cloud Support
          • AWS Reserved Instances
          • AWS Console
          • AWS EC2
          • Amazon Elastic Compute Cloud
          • EC2 Instances
          • Understanding Amazon AMI
        • Proficiency Level
          • Beginner
          • Advanced
          • Professional
        • Cloud Partners
        • Cloud Experts
      • Cloud Insight by Topic
        • Capacity
        • Utilization
        • Availability
        • Security
        • Financial Efficiency
      • Advanced Analytic Tools
        • Baseline Insights
        • Premium Insights
        • Business Groups
        • Reserved Instances
        • S3 Analytics
      • Cloud Baseline by Role
        • C-Level Cockpit
        • IT Managers View
        • Operators View
        • Developers View
      • Cloud Insight by AWS Service
        • Amazon EC2
        • Amazon S3
      • iPhone / iPad App
    • Newvem for Azure
      • Azure Beta Program
      • Knowledge Center
  • FEATURES
    • Free Cloud Care Features
    • Premium Cloud Care Features
  • PRICING
  • AZURE BETA
  • Newvem for AWS
  • Cloud Care Features
  • Newvem for Azure

Setting Up an Auto-Scaled and Load-Balanced Amazon EC2 Application

Subscribe to Our Weekly Newsletter
Submit

You are now subscribed!

Watch Newvem's Video

Most Popular Posts

  • Are You an AWS Cloud Expert? Find Out Now!
  • What’s CPU Steal Time?
  • Dissecting Amazon Elastic Load Balancer (ELB): 18 Facts You Should Know
  • The 10 Most Common Amazon’s AWS Usage Mistakes
  • The 5 Biggest Security Mistakes Users Make in Amazon’s Cloud

Tags

Amazon Cloud Services AWS Cloud Backup Best Practices Cloud Capacity CloudFront CloudWatch Consumption Cost Efficiency EBS EC2 ELB High Availability How-to Guide IAM Management and Control S3 Security Security Groups Utilization

Home»
AWS
»AWS Getting Started Guide
»Setting Up an Auto-Scaled and Load-Balanced Amazon EC2 Application

Setting Up an Auto-Scaled and Load-Balanced Amazon EC2 Application

The following steps will instruct you on how to set up an auto-scaled, load-balanced Amazon EC2 Application:

1)     Firstly, you will need to open a command prompt window on your computer.

(In Microsoft Windows, this can be done by starting the command prompt application (You can start it from the Start menu by clicking on Programs, then clicking on Accessories, and finally clicking on Command Prompt)).

2)     Now, you will need to use the Auto Scaling “as-create-launch-config” command.

For this particular example, we will be using a publicly available Windows AMI, running Microsoft Windows Server 2008 and Microsoft Internet Information Services (IIS).We will use a “t1.micro” instance type, and use the security group and key pair that we have already created in the previous steps. In this particular example, the key pair file is located in the same directory in which we are creating our Auto Scaling group. Also, we will not be specifying a region, as we are using the default region, US East (Virginia).

Note: The AMI being used in this particular example is a part of the AWS Free Usage Tier. Those eligible for the free tier will not be charged for launching the Amazon EC2 instance. However, if you are ineligible for the AWS Free Usage Tier, the charges incurred in this example are still minimal. For further information regarding Amazon EC2 pricing, please refer to the Amazon Elastic Compute Cloud (Amazon EC2) details page.

PROMPT> as-create-launch-config MyLC -image-id ami-498d5520 -instance-typet1.micro -group webappsecuritygroup -key mykeypair 

Auto Scaling will return the following:

OK-Created launch config 

Note: For ease, you can copy/paste the commands from the document into the command line window. To successfully copy/paste the contents in the command line window, use the right-click button on your mouse. If you still have trouble in getting the commands to work, please ensure that the command was pasted correctly.

3)    You will now be using the Auto Scaling “as-create-auto-scaling-group” command.

In this particular example, we will be using two Availability Zones. This is a very good way of building fault-tolerant applications, for if one Availability Zone experiences an outage, traffic will automatically be routed to another Availability Zone. Also, the number of instances being launched in the Auto-Scaling group will be automatically, and evenly, distributed across the Availability Zones.

PROMPT>as-create-auto-scaling-group MyAutoScalingGroup -launch-configuration MyLC -availability-zones us-east-1b, us-east-1c -min-size 1 -max-size 1 -load-balancers MyLB 

Auto Scaling will return an output which is similar to the following example output:

OK-Created AutoScalingGroup 

4)      Now, we will use the Auto Scaling “as-put-scaling-policy” command, and create a policy that will enlarge your fleet of instances.

PROMPT>as-put-scaling-policy MyScaleUpPolicy -auto-scaling-group MyAutoScal

ingGroup -adjustment=1 -type ChangeInCapacity -cooldown 300

Auto Scaling will again return an output similar to the following example output:

POLICY-ARN arn:aws:autoscaling:us-east-1:012345678901:scalingPolicy:cbe7da4e-5d00-4882-900a 2f8113431e30:autoScalingGroupName/MyAutoScalingGroup:policyName/MyScaleUpPolicy 

Note: In this particular example, we are only creating a scale-out policy to save time. However, you should create a scale-in policy as well. Auto-Scaling helps in decreasing the number of instances when an application doesn’t need the resources, thus saving you money. To successfully create a scale-in policy, change the policy name, and also change the adjustment from 1 to -1.

5)      Finally, we will verify the existence of your Auto Scaling group, by using the “as-describe-auto-scaling-groups” command.

PROMPT>as-describe-auto-scaling-groups MyAutoScalingGroup -headers 

Auto-Scaling will return the following:

AUTO-SCALING-GROUP GROUP-NAME LAUNCH-CONFIG AVAILABILITY-ZONES

MIN-SIZE MAX-SIZE DESIRED-CAPACITY

AUTO-SCALING-GROUP MyAutoScalingGroup MyLC us-east-1b,us-east-

1c 1 1 1

INSTANCE INSTANCE-ID AVAILABILITY-ZONE STATE STATUS LAUNCH-CONFIG

INSTANCE i-xxxxxxxx us-east-1c InService Healthy MyLC

Congratulations! You have just launched an auto-scaled and load-balanced Amazon EC2 application. For further information on Auto-Scaling, please refer to the Auto-Scaling   Documentation. Costs will be incurred by you as long as your Amazon EC2 instances are running. To terminate these instances, please refer to the How to Terminate EC2 Instances section.

 

Subscribe to Our Weekly Newsletter
Submit

You are now subscribed!

Watch Newvem's Video

Most Popular Posts

  • Are You an AWS Cloud Expert? Find Out Now!
  • What’s CPU Steal Time?
  • Dissecting Amazon Elastic Load Balancer (ELB): 18 Facts You Should Know
  • The 10 Most Common Amazon’s AWS Usage Mistakes
  • The 5 Biggest Security Mistakes Users Make in Amazon’s Cloud

Tags

Amazon Cloud Services AWS Cloud Backup Best Practices Cloud Capacity CloudFront CloudWatch Consumption Cost Efficiency EBS EC2 ELB High Availability How-to Guide IAM Management and Control S3 Security Security Groups Utilization

Top
12

2021 Hot Cloud
Computing Company

Company

  • About Newvem
  • On Bloomberg TV
  • Profit from the Cloud
  • In the News
  • Our Team
  • Jobs
  • Our Clients
  • Press Release
  • Terms of Use
  • Privacy Policy
  • White Paper

Hot Topics

  • Cloud Smart Meter
  • AWS Infographic
  • Reserved Instance Marketplace
  • 10 AWS Usage Mistakes
  • 5 AWS Security Mistakes
  • AWS Usage Tips
  • Amazon S3 Analytics

Solutions

  • Cloud Smart Meter App
  • AWS Reserved Instances Calculator
  • S3 Analytic Tool
  • How It Works
  • How to Get Started
  • AWS Support
  • C-Level View
  • IT Manager View
  • Cloud Operator View
  • Developer View
  • AWS cloud for the enterprise
  • Analytics for Azure

CloudPedia

  • CloudPedia
  • Cloud Radar
  • AWS Getting Started Guide
  • Prepare for AWS Outages
  • Best Practice Insights
  • Effective AWS EC2
  • AWS Financial Efficiency
  • AWS Availability
  • AWS Security
  • AWS Training
  • AWS Usage Tips

Contact Us

  • Support
  • Contact Us

Stay connected

© 2020 - 2022. Newvem Insight Ltd. All Rights Reserved.