gpt4 book ai didi

amazon-web-services - AWS 代码部署 + bitbucket = 失败(错误代码 HEALTH_CONSTRAINTS)

转载 作者:行者123 更新时间:2023-12-03 00:28:32 29 4
gpt4 key购买 nike

我已经根据这篇文章设置了一切

https://aws.amazon.com/tw/blogs/apn/announcing-atlassian-bitbucket-support-for-aws-codedeploy/

这是我的环境:

实例(亚马逊 Linux 免费套餐)
- 已安装 Apache 2.4

安全组
- 只开放22(只有我的ip可以访问)和80端口

Iptables 已停止

2 个角色已设置
- 用于链接 S3 <-> bitbucket 的一个 (附定制政策)
- 一个角色用于部署组 (附AWSCodeDeployRole策略)

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "codedeploy.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}

尝试部署的脚本
https://s3.amazonaws.com/aws-codedeploy-us-east-1/samples/latest/SampleApp_Linux.zip

权限/var/www/* 属于具有 755 权限的 ec2-user

代理服务代码部署代理状态=AWS CodeDeploy 代理正在以 PID 7200 运行

线索:我的 s3 存储桶中有一些 zip 文件会在每次部署时上传。

错误代码:HEALTH_CONSTRAINTS

有人知道部署失败的原因是什么吗?

update1 在我使用 iam 配置文件重新启动实例后,可以部署应用程序。但仍然失败,当我点击查看事件时,有如下日志:

Error CodeScriptFailed
Script Namescripts/install_dependencies
MessageScript at specified location: scripts/install_dependencies run as user root failed with exit code 1
Log TailLifecycleEvent - BeforeInstall
Script - scripts/install_dependencies
[stdout]Loaded plugins: priorities, update-motd, upgrade-helper
[stdout]Resolving Dependencies
[stdout]--> Running transaction check
[stdout]---> Package httpd.x86_64 0:2.2.31-1.8.amzn1 will be installed
[stdout]--> Processing Dependency: httpd-tools = 2.2.31-1.8.amzn1 for package: httpd-2.2.31-1.8.amzn1.x86_64
[stdout]--> Processing Dependency: apr-util-ldap for package: httpd-2.2.31-1.8.amzn1.x86_64
[stdout]--> Running transaction check
[stdout]---> Package apr-util-ldap.x86_64 0:1.4.1-4.17.amzn1 will be installed
[stdout]---> Package httpd-tools.x86_64 0:2.2.31-1.8.amzn1 will be installed
[stdout]--> Processing Conflict: httpd24-2.4.23-1.66.amzn1.x86_64 conflicts httpd < 2.4.23
[stdout]--> Processing Conflict: httpd24-tools-2.4.23-1.66.amzn1.x86_64 conflicts httpd-tools < 2.4.23
[stdout]--> Finished Dependency Resolution
[stderr]Error: httpd24-tools conflicts with httpd-tools-2.2.31-1.8.amzn1.x86_64
[stderr]Error: httpd24 conflicts with httpd-2.2.31-1.8.amzn1.x86_64
[stdout] You could try using --skip-broken to work around the problem
[stdout] You could try running: rpm -Va --nofiles --nodigest

大家有什么问题吗?

最佳答案

错误代码 HEALTH_CONSTRAINTS 表示失败的实例数量超出预期,这是由部署配置定义的。

有关部署失败原因的详细信息,请在部署控制台 https://region.console.aws.amazon.com/codedeploy/home?region=region#/deployments ,您可以点击失败的部署ID,然后它会重定向到部署详细信息页面,该页面包含指定部署中包含的所有实例,并且每一行包含该实例的生命周期事件。然后点击ViewEvents,如果有View Logs链接,就可以看到该实例部署失败的原因。

如果控制台没有足够的信息来满足您的需要,则可以在 less/var/log/aws/codedeploy-agent/codedeploy-agent.log 中找到实例日志。它包含最近部署的日志。

关于amazon-web-services - AWS 代码部署 + bitbucket = 失败(错误代码 HEALTH_CONSTRAINTS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38762156/

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