从 t2 移动到 t3(或 t4)实例超时

Moving from t2 to t3 (or t4) instance times out

我有一个带有 t2.xxxxx 个实例的 EB 环境,我希望更改为 t3(或将来的任何其他实例)

运行 eb config 打开我的配置文件。

我将 InstanceTypet2.small 更改为 t3.small,将 InstanceTypest2.small, t2.medium 更改为 t3.small, t3.medium

我已经使用 AWS cli 确认启用了 ENA:

aws ec2 describe-instances --instance-ids i-xxxx --query "Reservations[].Instances[].EnaSupport"
aws ec2 describe-images --image-id ami-xxxx --query "Images[].EnaSupport"

这两个 return [ true ]

错误:

Printing Status:
Environment update is starting.      
Updating environment xxxx's configuration settings.
Created Auto Scaling launch configuration named: xxxx
Auto Scaling group update progress: Rolling update initiated. Terminating 1 obsolete instance(s) in batches of 1, while keeping at least 1 instance(s) in service. Waiting on resource signals with a timeout of PT30M when new instances are added to the autoscaling group.
Auto Scaling group update progress: Temporarily setting autoscaling group MinSize and DesiredCapacity to 2.
Auto Scaling group update progress: New instance(s) added to autoscaling group - Waiting on 1 resource signal(s) with a timeout of PT30M.
Still waiting for the following 1 instances to become healthy: [i-xxxx].
                                                                      
ERROR: TimeoutError - The EB CLI timed out after 10 minute(s). The operation might still be running. To keep viewing events, run 'eb events -f'. To set timeout duration, use '--timeout MINUTES'.

编辑

使用 eb events -f 我可以看到更多日志

ERROR   Service:AmazonCloudFormation, Message:Stack named 'awseb-x-xxxx-xxxx' aborted operation. Current state: 'UPDATE_ROLLBACK_IN_PROGRESS'  Reason: null
INFO    Auto Scaling group update progress: Failed to receive 1 resource signal(s) for the current batch.  Each resource signal timeout is counted as a FAILURE.
ERROR   Updating Auto Scaling group named: awseb-e-xxxx-xxxx-AWSEBAutoScalingGroup-xxxx failed Reason: Received 0 SUCCESS signal(s) out of 1.  Unable to satisfy 100% MinSuccessfulInstancesPercent requirement
ERROR   Failed to deploy configuration.
INFO    Created Auto Scaling launch configuration named: awseb-e-xxxx-xxxx-AWSEBAutoScalingLaunchConfiguration-xxxx
INFO    Auto Scaling group update progress: Rolling update initiated. Terminating 1 obsolete instance(s) in batches of 1, while keeping at least 1 instance(s) in service. Waiting on resource signals with a timeout of PT30M when new instances are added to the autoscaling group.

编辑

参见 config 下面:

的编辑版本
ApplicationName: xxxx
DateUpdated: 2022-02-24 12:31:13+00:00
EnvironmentName: xxxx-dev
PlatformArn: arn:aws:elasticbeanstalk:xxxx::platform/Python 3.8 running on 64bit
  Amazon Linux 2/3.3.9
settings:
  aws:autoscaling:launchconfiguration:
    BlockDeviceMappings: null
    DisableIMDSv1: xxxx
    EC2KeyName: xxxx
    IamInstanceProfile: xxxx
    ImageId: xxxx
    InstanceType: t2.small
    MonitoringInterval: 5 minute
SSHSourceRestriction: xxxx
    SecurityGroups: xxxx
  aws:ec2:instances:
    EnableSpot: 'false'
    InstanceTypes: t2.small, t2.medium
    SpotFleetOnDemandAboveBasePercentage: '70'
    SpotFleetOnDemandBase: '0'
    SpotMaxPrice: null
    SupportedArchitectures: x86_64
  aws:elasticbeanstalk:command:
    DeploymentPolicy: Rolling
  aws:elasticbeanstalk:container:python:
    NumProcesses: '1'
    NumThreads: '15'
    WSGIPath: application
  aws:elasticbeanstalk:control:
    DefaultSSHPort: '22'
    LaunchTimeout: '0'
    LaunchType: Migration
    RollbackLaunchOnFailure: 'false'
  aws:elasticbeanstalk:environment:
    EnvironmentType: LoadBalanced
    LoadBalancerIsShared: 'false'
    LoadBalancerType: application

查看后端 CloudFormation 堆栈以检查配置更新失败的原因。看样子,wait condition好像没能及时收到信号

如果实例没有与 AWS 的连接,或者如果新实例上的应用程序部署花费的时间比完成部署所配置的时间长,则可能会发生这种情况。

检查您是否也在使用任何生命周期挂钩,它们也可能导致问题。

您也可以查看日志以了解相同情况。如果问题出在信号上,请检查 cfn-wire.log 文件。

所以要解决这个问题,基于来自的输入:

  1. 我删除了当前目录中的 .elasticbeanstalk 文件夹。
  2. eb init(根据需要设置)
  3. eb create(根据需要设置)
  4. eb config(如题中所愿设置)

第一次工作。