选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

ExitStandby 与 CLI 配合使用

聚焦模式
将 ExitStandby 与 CLI 配合使用 - Amazon A EC2 uto Scaling

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

以下代码示例演示如何使用 ExitStandby

CLI
AWS CLI

将实例移出备用模式

此示例将指定的实例移出备用模式。

aws autoscaling exit-standby \ --instance-ids i-061c63c5eb45f0416 \ --auto-scaling-group-name my-asg

输出:

{ "Activities": [ { "ActivityId": "142928e1-a2dc-453a-9b24-b85ad6735928", "AutoScalingGroupName": "my-asg", "Description": "Moving EC2 instance out of Standby: i-061c63c5eb45f0416", "Cause": "At 2020-10-31T20:32:50Z instance i-061c63c5eb45f0416 was moved out of standby in response to a user request, increasing the capacity from 0 to 1.", "StartTime": "2020-10-31T20:32:50.222Z", "StatusCode": "PreInService", "Progress": 30, "Details": "{\"Subnet ID\":\"subnet-6194ea3b\",\"Availability Zone\":\"us-west-2c\"}" } ] }

有关更多信息,请参阅 Amazon Auto Scaling 用户指南中的临时从 Aut EC2 o Sc aling 组中移除实例

  • 有关 API 的详细信息,请参阅AWS CLI 命令参考ExitStandby中的。

PowerShell
用于 PowerShell

示例 1:此示例将指定的实例移出备用模式。

Exit-ASStandby -InstanceId i-93633f9b -AutoScalingGroupName my-asg

输出

ActivityId : 1833d3e8-e32f-454e-b731-0670ad4c6934 AutoScalingGroupName : my-asg Cause : At 2015-11-22T15:51:21Z instance i-95b8484f was moved out of standby in response to a user request, increasing the capacity from 1 to 2. Description : Moving EC2 instance out of Standby: i-95b8484f Details : {"Availability Zone":"us-west-2b","Subnet ID":"subnet-5264e837"} EndTime : Progress : 30 StartTime : 11/22/2015 7:51:21 AM StatusCode : PreInService StatusMessage :
  • 有关 API 的详细信息,请参阅 AWS Tools for PowerShell Cmdlet 参考ExitStandby中的。

AWS CLI

将实例移出备用模式

此示例将指定的实例移出备用模式。

aws autoscaling exit-standby \ --instance-ids i-061c63c5eb45f0416 \ --auto-scaling-group-name my-asg

输出:

{ "Activities": [ { "ActivityId": "142928e1-a2dc-453a-9b24-b85ad6735928", "AutoScalingGroupName": "my-asg", "Description": "Moving EC2 instance out of Standby: i-061c63c5eb45f0416", "Cause": "At 2020-10-31T20:32:50Z instance i-061c63c5eb45f0416 was moved out of standby in response to a user request, increasing the capacity from 0 to 1.", "StartTime": "2020-10-31T20:32:50.222Z", "StatusCode": "PreInService", "Progress": 30, "Details": "{\"Subnet ID\":\"subnet-6194ea3b\",\"Availability Zone\":\"us-west-2c\"}" } ] }

有关更多信息,请参阅 Amazon Auto Scaling 用户指南中的临时从 Aut EC2 o Sc aling 组中移除实例

  • 有关 API 的详细信息,请参阅AWS CLI 命令参考ExitStandby中的。

有关 S AWS DK 开发者指南和代码示例的完整列表,请参阅将此服务与 AWS SDK 配合使用。本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。