自动缩放组中的新实例的 Elastic Beanstalk ebextension 配置不是 运行
Elastic Beanstalk ebextension config not running for new instance in autoscaling group
希望知道如何解决这个问题!
我在 Elastic Beanstalk 中有一个 .NET Web 应用程序 运行ning,它需要通过 ebextensions 完成一些事情。创建实例后它始终如一地工作,但是在创建实例时,似乎存在问题。
在日志文件中,有以下内容:
2015-03-12 15:44:36,901 [INFO] Running config postbuild_0_MyConfig
2015-03-12 15:44:38,309 [ERROR] -----------------------BUILD FAILED!------------------------
2015-03-12 15:44:38,309 [ERROR] Unhandled exception during build: [Error 267] The directory name is invalid
Traceback (most recent call last):
File "cfn-init", line 123, in <module>
File "cfnbootstrap\construction.pyc", line 117, in build
File "cfnbootstrap\construction.pyc", line 502, in build
File "cfnbootstrap\construction.pyc", line 513, in run_config
File "cfnbootstrap\construction.pyc", line 125, in run_commands
File "cfnbootstrap\command_tool.pyc", line 104, in apply
File "cfnbootstrap\util.pyc", line 468, in call
File "cfnbootstrap\util.pyc", line 454, in call
File "subprocess.pyc", line 679, in __init__
File "subprocess.pyc", line 896, in _execute_child
WindowsError: [Error 267] The directory name is invalid
失败后,我将 运行 使用来自 AWS 控制台的相同代码版本再次部署,我得到:
2015-03-12 16:00:42,526 [INFO] Running config postbuild_0_Umbraco
2015-03-12 16:00:44,558 [INFO] Command 01-changeperm succeeded
2015-03-12 16:00:44,558 [INFO] Waiting 60 seconds for reboot
2015-03-12 16:01:47,322 [INFO] Command 02-createvirtualdirectory succeeded
2015-03-12 16:01:47,338 [INFO] Waiting 60 seconds for reboot
符合预期。
我相信它一定是由于配置文件本身而失败,因为个别命令本身的问题会导致不同的错误。
这是部署到 .ebextensions 文件夹中的我的 .config 文件,以及引用的脚本:
container_commands:
01-changeperm:
command: "permissions.bat > ../eblog.log"
cwd: "C:/inetpub/wwwroot/.ebextensions"
02-createvirtualdirectory:
command: "powershell.exe -noprofile -executionpolicy bypass -file ./virtualdir.ps1 > ../vd.log"
cwd: "C:/inetpub/wwwroot/.ebextensions"
希望有人能帮我解决这个问题,因为我很茫然!如果有人需要更多信息,请询问!
提前致谢。
由于 webdeploy 包的部署方式,Windows 上配置的执行略有不同。
因此,您不能依赖磁盘上存在的 .ebextensions 文件夹(或您的包中的任何文件)中的任何文件(这不是实际执行脚本的地方)。
您的 .ebextensions 配置中的命令在您的任何位写入磁盘之前执行(甚至 container_commands)。
出于这个原因,您可能需要内联您的 bat 文件和 ps1 脚本,或者将它们放入 S3,然后使用 file: 指令放置它们。
希望知道如何解决这个问题!
我在 Elastic Beanstalk 中有一个 .NET Web 应用程序 运行ning,它需要通过 ebextensions 完成一些事情。创建实例后它始终如一地工作,但是在创建实例时,似乎存在问题。
在日志文件中,有以下内容:
2015-03-12 15:44:36,901 [INFO] Running config postbuild_0_MyConfig
2015-03-12 15:44:38,309 [ERROR] -----------------------BUILD FAILED!------------------------
2015-03-12 15:44:38,309 [ERROR] Unhandled exception during build: [Error 267] The directory name is invalid
Traceback (most recent call last):
File "cfn-init", line 123, in <module>
File "cfnbootstrap\construction.pyc", line 117, in build
File "cfnbootstrap\construction.pyc", line 502, in build
File "cfnbootstrap\construction.pyc", line 513, in run_config
File "cfnbootstrap\construction.pyc", line 125, in run_commands
File "cfnbootstrap\command_tool.pyc", line 104, in apply
File "cfnbootstrap\util.pyc", line 468, in call
File "cfnbootstrap\util.pyc", line 454, in call
File "subprocess.pyc", line 679, in __init__
File "subprocess.pyc", line 896, in _execute_child
WindowsError: [Error 267] The directory name is invalid
失败后,我将 运行 使用来自 AWS 控制台的相同代码版本再次部署,我得到:
2015-03-12 16:00:42,526 [INFO] Running config postbuild_0_Umbraco
2015-03-12 16:00:44,558 [INFO] Command 01-changeperm succeeded
2015-03-12 16:00:44,558 [INFO] Waiting 60 seconds for reboot
2015-03-12 16:01:47,322 [INFO] Command 02-createvirtualdirectory succeeded
2015-03-12 16:01:47,338 [INFO] Waiting 60 seconds for reboot
符合预期。
我相信它一定是由于配置文件本身而失败,因为个别命令本身的问题会导致不同的错误。
这是部署到 .ebextensions 文件夹中的我的 .config 文件,以及引用的脚本:
container_commands:
01-changeperm:
command: "permissions.bat > ../eblog.log"
cwd: "C:/inetpub/wwwroot/.ebextensions"
02-createvirtualdirectory:
command: "powershell.exe -noprofile -executionpolicy bypass -file ./virtualdir.ps1 > ../vd.log"
cwd: "C:/inetpub/wwwroot/.ebextensions"
希望有人能帮我解决这个问题,因为我很茫然!如果有人需要更多信息,请询问!
提前致谢。
由于 webdeploy 包的部署方式,Windows 上配置的执行略有不同。
因此,您不能依赖磁盘上存在的 .ebextensions 文件夹(或您的包中的任何文件)中的任何文件(这不是实际执行脚本的地方)。
您的 .ebextensions 配置中的命令在您的任何位写入磁盘之前执行(甚至 container_commands)。
出于这个原因,您可能需要内联您的 bat 文件和 ps1 脚本,或者将它们放入 S3,然后使用 file: 指令放置它们。