简体   繁体   English

AWS实例在不同的可用区域中

[英]aws run-instances in different availability zones

How can I launch a set of instances having each into a different AZ in EC2-Classic using the AWS CLI? 如何使用AWS CLI在EC2-Classic中启动将每个实例放入不同AZ的一组实例?

According to this documentation, using --placement AvailabilityZone=us-west-2c allows me to specify one AZ, but what if I also use --count 3 and want each in different AZ? 根据文档,使用--placement AvailabilityZone=us-west-2c可以指定一个--count 3 ,但是如果我也使用--count 3并希望每个使用不同的--count 3 ,该怎么办?

The traditional way to do this is to use Amazon EC2 Auto Scaling . 传统方法是使用Amazon EC2 Auto Scaling

Auto Scaling can be configured to run EC2 servers across multiple Availability Zones. 可以将Auto Scaling配置为跨多个可用区运行EC2服务器。 In addition, if a server fails (or if an Availability Zone fails), it can automatically launch replacement servers. 此外,如果服务器发生故障(或可用区发生故障),它可以自动启动替换服务器。

If you do not wish to use Auto Scaling, you will need to use separate API calls to launch instances in each Availability Zone. 如果您希望使用Auto Scaling,则需要使用单独的API调用在每个可用区中启动实例。

Alternatively, you could use AWS CloudFormation , which can launch a collection of infrastructure in your account. 或者,您可以使用AWS CloudFormation ,它可以在您的帐户中启动一系列基础架构。 One template can launch instances in different availability zones (but would need separate specifications, just like issuing multiple API calls). 一个模板可以在不同的可用区域中启动实例(但需要单独的规范,就像发出多个API调用一样)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM