gpt4 book ai didi

amazon-elastic-beanstalk - Elastic Beanstalk 环境不在 .ebextensions 文件夹中执行命令

转载 作者:行者123 更新时间:2023-12-04 17:54:27 34 4
gpt4 key购买 nike

我有一个运行 PHP 的弹性 beanstalk 环境。在我的项目中,我有一个 .ebextensions 文件夹和一个名为“15-memorymonitor.config”的文件,其中包含以下内容;

container_commands:
00download:
command: "wget http://ec2-downloads.s3.amazonaws.com/cloudwatch-samples/CloudWatchMonitoringScripts-v1.1.0.zip"
ignoreErrors: true
01extract:
ignoreErrors: true
02rmzip:
command: "rm CloudWatchMonitoringScripts-v1.1.0.zip"
ignoreErrors: true
03cdinto:
command: "mv aws-scripts-mon/ /home/ec2-user"
ignoreErrors: true
04cron:
command: "crontab -l | { cat; echo '* * * * * /home/ec2-user/aws-scripts-mon/mon-put-instance-data.pl --mem-util --mem-used --mem-avail'; } | crontab -"
ignoreErrors: false

问题是在部署应用程序时,这些命令似乎都没有执行。我检查了 cfn.init 文件以查找对配置文件中命令的引用,但没有。

这是 cfn.init 文件的内容。

2017-01-03 15:02:21,666 [INFO] -----------------------Starting build-----------------------
2017-01-03 15:02:21,689 [INFO] Running configSets: _OnInstanceBoot
2017-01-03 15:02:21,690 [INFO] Running configSet _OnInstanceBoot
2017-01-03 15:02:21,692 [INFO] Running config AWSEBBaseConfig
2017-01-03 15:02:21,697 [INFO] Command clearbackupfiles succeeded
2017-01-03 15:02:21,744 [INFO] Running config AWSEBMessageOfTheDay
2017-01-03 15:02:21,749 [INFO] Command 01clearoriginal succeeded
2017-01-03 15:02:21,753 [INFO] Command 02createbanner succeeded
2017-01-03 15:02:21,809 [INFO] Command 03updatebanner succeeded
2017-01-03 15:02:21,815 [INFO] Running config AWSEBULimitConfig
2017-01-03 15:02:21,818 [INFO] Command 00removebackup succeeded
2017-01-03 15:02:21,823 [INFO] Running config Infra-InstallContainerHooksPkg
2017-01-03 15:02:21,827 [INFO] Command 00mkdir succeeded
2017-01-03 15:02:21,939 [INFO] Command 01download_container_hooks succeeded
2017-01-03 15:02:21,976 [INFO] Command 02install_container_hooks succeeded
2017-01-03 15:02:21,980 [INFO] Command 03cleanup succeeded
2017-01-03 15:02:21,986 [INFO] Running config Infra-WriteLeaderTestScript
2017-01-03 15:02:21,991 [INFO] Running config Infra-WriteTailLogsConf
2017-01-03 15:02:21,996 [INFO] Running config Infra-WriteSystemTailLogsConf
2017-01-03 15:02:22,002 [INFO] Running config Infra-WriteBundleLogsConf
2017-01-03 15:02:22,006 [INFO] Running config Infra-WritePublishLogsConf
2017-01-03 15:02:22,009 [INFO] Running config Infra-WritePublishLogsCron
2017-01-03 15:02:22,011 [INFO] ConfigSets completed
2017-01-03 15:02:22,099 [INFO] -----------------------Build complete-----------------------
2017-01-03 15:02:50,301 [INFO] -----------------------Starting build-----------------------
2017-01-03 15:02:50,397 [INFO] Running configSets: Infra-EmbeddedPreBuild
2017-01-03 15:02:50,398 [INFO] Running configSet Infra-EmbeddedPreBuild
2017-01-03 15:02:50,398 [INFO] ConfigSets completed
2017-01-03 15:02:50,401 [INFO] -----------------------Build complete-----------------------
2017-01-03 15:02:52,690 [INFO] -----------------------Starting build-----------------------
2017-01-03 15:02:53,496 [INFO] Running configSets: Infra-EmbeddedPostBuild
2017-01-03 15:02:53,497 [INFO] Running configSet Infra-EmbeddedPostBuild
2017-01-03 15:02:53,497 [INFO] ConfigSets completed
2017-01-03 15:02:53,500 [INFO] -----------------------Build complete-----------------------
2017-01-03 15:09:21,577 [INFO] -----------------------Starting build-----------------------
2017-01-03 15:09:21,599 [INFO] Running configSets: Infra-EmbeddedPreBuild
2017-01-03 15:09:21,600 [INFO] Running configSet Infra-EmbeddedPreBuild
2017-01-03 15:09:21,600 [INFO] ConfigSets completed
2017-01-03 15:09:21,603 [INFO] -----------------------Build complete-----------------------
2017-01-03 15:09:24,358 [INFO] -----------------------Starting build-----------------------
2017-01-03 15:09:24,472 [INFO] Running configSets: Infra-EmbeddedPostBuild
2017-01-03 15:09:24,473 [INFO] Running configSet Infra-EmbeddedPostBuild
2017-01-03 15:09:24,473 [INFO] ConfigSets completed
2017-01-03 15:09:24,475 [INFO] -----------------------Build complete-----------------------

有谁知道为什么这些命令不会执行?

我通过 AWS Web 控制台部署我的应用程序(作为 zip 文件)。

最佳答案

我设法解决了这个问题。我正在通过 AWS 控制台部署我的应用程序,但由于某种原因它没有提取配置文件。

为了让它工作,我改为通过 eb cli 工具部署了应用程序,而且它成功了!

您可以在下面的链接中阅读有关 eb cli 的更多信息; http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3.html

关于amazon-elastic-beanstalk - Elastic Beanstalk 环境不在 .ebextensions 文件夹中执行命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41566063/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com