如何增加 Elastic Beanstalk 部署的超时时间?

如何增加 Elastic Beanstalk 部署的超时时间?

commands作为应用程序部署的一部分,我的配置文件中有一些.ebextensions。第一次运行命令(克隆大型存储库)时,所有命令可能需要 20 分钟或更长时间才能完成。

不幸的是,这会在部署期间触发超时:

INFO Deploying new version to instance(s).
WARN The following instances have not responded in the allowed command
     timeout time (they might still finish eventually on their own).
INFO Command execution completed. Summary: [Successful: 0, TimedOut: 1].

是否可以增加此超时时间?我在我的环境设置中找不到该选项。

答案1

你可以加AWS Elastic Beanstalk 配置文件(.ebextensions)添加到您的 Web 应用程序的源代码中,以配置您的环境并自定义其中包含的 AWS 资源。

配置文件的部分option_settings定义了配置选项。配置选项允许您配置您的 Elastic Beanstalk 环境、其中的 AWS 资源以及运行您的应用程序的软件。

将配置文件添加到名为 .ebextensions 的文件夹中的源代码中,并将其部署到应用程序源包中。

例子:

option_settings:
    - namespace: aws:elasticbeanstalk:command
      option_name: Timeout
      value: 1000

*“value”表示超时前的时间长度,以秒为单位。

参考:官方AWS Elastic Beanstalk环境配置适用于所有环境的常规选项stackoverflow 答案和AWS 开发者论坛帖子。

答案2

您可以将存储库嵌入到 AMI 中,并让 elastic beanstalk 使用它。这样,结帐时间就不会太长。

另外,你为什么要克隆大量的仓库作为部署

相关内容