amazon-web-services - 并行启动多个 EC2 实例

标签 amazon-web-services amazon-ec2 amazon

我想并行启动多台 EC2 机器。到目前为止,我一直在使用 boto 和 fabric,但串行执行需要很长时间才能一一启动和配置它们。任何替代解决方案/工具来做到这一点?

最佳答案

亚马逊命令行工具支持实例数量参数。

aws ec2 run-instances help
   --count (string)
      Number of instances to launch. If a single number is provided, it is
      assumed  to  be the minimum to launch (defaults to 1). If a range is
      provided in the form min:max then the first number is interpreted as
      the  minimum  number of instances to launch and the second is inter-
      preted as the maximum number of instances to launch.

如果您运行的是较旧的 CLI:
ec2-run-instances
 -n, --instance-count MIN[-MAX]
      The number of instances to attempt to launch. May be specified as a
      single integer or as a range (min-max). This specifies the minimum
      and maximum number of instances to attempt to launch. If a single
      integer is specified min and max are both set to that value.

更新:根据 boto ec2 文档,您可以将 min_count 和 max_count 参数传递给 run_instances 命令,这也可以让您并行启动多个实例。

关于amazon-web-services - 并行启动多个 EC2 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20614655/

相关文章:

amazon-web-services - 将AWS SQS连接到Apache-Flink

java - AWS VPC 中的 docker 容器,好主意与否?

amazon-web-services - S3 : An error occurred (AccessDenied) when calling the GetObject operation: Access Denied

amazon-ec2 - 保持 EC2 免费实例免费

amazon-web-services - 如何仅从亚马逊的产品广告 API 获取产品名称?

api - 亚马逊产品广告 API - 项目不可访问

swift - 将 AWS key 保存在 github 之外

amazon-web-services - AWS ECS 使用相同的任务定义和镜像重新启动服务,无需停机

amazon-web-services - AWS Cloudfront 重定向 TOO_MANY 次

amazon-web-services - 在 EC2 Ubuntu 或 Linux 中记录每个请求和输出