阅读背景:

从Dockerrun.aws.json -AWS增加EBS中的命令超时

来源:互联网 

I am deploying a Dockerfile and a Dockerrun.aws.json in Elastic beanstalk and it was giving an error because some commands were surpassing the maximum command timeout. I can fix this error by going to Updates and Deployments, and modifying the maximum timeout. But I would like to know if there is a command to increase the maximum command timeout of EBS from the Dockerrun.aws.json? or another way to do that automatically ?

我在Elastic beanstalk中部署了一个Dockerfile和一个Dockerrun.aws.json,并且由于某些命令超过了最大命令超时而发出错误。我可以通过转到更新和部署以及修改最大超时来修复此错误。但我想知道是否有一个命令来增加Dockerrun.aws.json中EBS的最大命令超时?或另一种方法自动执行此操作?

2 个解决方案

#1


No you cannot increase the timeout using Dockerrun.aws.json but you can bundle an ebextension in your app source with this option setting.

不,您不能使用Dockerrun.aws.json增加超时,但您可以使用此选项设置在应用源中捆绑ebextension。

Create a file in your app source in a directory called .ebextensions. Lets say the file is .ebextensions/01-increase-timeout.config.

在名为.ebextensions的目录中的应用程序源中创建一个文件。让我们说文件是.ebextensions / 01-increase-timeout.config。

The contents of the file should be:

该文件的内容应为:

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

Note this file is in YAML format. After this you can update your environment with this version of source code.

请注意,此文件采用YAML格式。在此之后,您可以使用此版本的源代码更新您的环境。

Previously answered here: https://stackoverflow.com/a/25558805/161628

以前在这里回答:https://stackoverflow.com/a/25558805/161628

#2


Another option is to do this using the Aws Tools for Windows PowerShell. This one liner will get every EB environment in your account and then set the command timeout to 400 seconds, with a 15 second sleep between each command to avoid AWS's API rate limits.

另一个选项是使用Windows PowerShell的Aws工具执行此操作。这个衬管将获得您帐户中的每个EB环境,然后将命令超时设置为400秒,每个命令之间休眠15秒,以避免AWS的API速率限制。

PS C:\> get-ebenvironment | % {start-sleep -Seconds 15;  Update-EBEnvironment -ApplicationName $_.ApplicationName -EnvironmentName $_.EnvironmentName -OptionSetting @{"namespace"="aws:elasticbeanstalk:command"; "optionName"="Timeout";  "value"=400} }

分享到: