Use auto scaling in Amazon

Source: Internet
Author: User

1. register an account go
Aws.amazon.com/ec2 and click sign up for Amazon ec2.

2. Download the command line tool download the command-line tools from
Auto scaling tools.

3. Set the Java path and auto scaling path, if Java is not installed, You need to first install, http://www.java.com/en/download/index.jsp

Export Path = $ path: $ java_home/bin
Export aws_auto_scaling_home =/home/admin/AutoScaling-1.0.33.1
Export Path = $ path: $ aws_auto_scaling_home/bin

4. Configure the certificate

(1) create a file namedcredential-file-path.template

The content is as follows:

Awsaccesskeyid = Your keyid
Awssecretkey = your certificate Password

5. Execute

chmod 600 [credential file name]

6. Set the certificate path

export AWS_CREDENTIAL_FILE=<PATH> 

7. Final executionAs-cmd, the following content will appear before it is successful.

Command Name                                Description                                            ------------                                -----------                                            as-create-auto-scaling-group                Create a new auto scaling group

8. Create a configuration with an AMI

Amid: ami-0606ad07
Amid: ami-e2f144e3

(1) create a config

As-create-launch-config mylc -- region ap-northeast-1 -- image-ID ami-e2f144e3 -- instance-type t1.micro

(2) Delete config

As-delete-launch-config mylc -- region ap-northeast-1

(3) view configurations

As-describe-launch-configs -- region ap-northeast-1

9. To create a group, you must specify a Server Load balancer instance. In this case, the added instance is added to this balancer instance, for example, my-load-balancer.

(1) as-create-auto-scaling-group mygroup -- launch-configuration mylc -- availability-zones ap-northeast-1a -- region ap-northeast-1 -- Min-size 1 -- Max-size 3 -- load-balancers my-Load -balancer

(2) view group

As-describe-auto-scaling-groups -- headers -- region ap-northeast-1

(3) Delete A group

As-Update-auto-scaling-group mygroup -- Min-size 0 -- Max-size 0 -- region ap-northeast-1

As-delete-auto-scaling-group mygroup -- region ap-northeast-1

(4) to reload the configuration file, you need to set the region

As-describe-launch-configs -- AWS-Credential-file/home/admin/credential-file-path.template -- region ap-northeast-1

10. Select ELB on cloudwatch on the control interface, create an alarm, and set the conditions.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.