我已經根據本文AWS代碼部署+ =到位桶失敗(錯誤代碼HEALTH_CONSTRAINTS)
https://aws.amazon.com/tw/blogs/apn/announcing-atlassian-bitbucket-support-for-aws-codedeploy/
這裏設置的一切是我的ENV:
實例(自由層與亞馬遜linux)
- apache 2.4安裝
安全組
- 只有22(只有我的IP可以訪問)和80端口被打開
iptables的停止
2角色設置
- 一個用於連接S3 < - >到位桶 (附自定義策略)
- 一個角色是部署組 (附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/*由EC2用戶755許可
代理 服務codedeploy代理狀態資= 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
任何人有什麼問題?
我找到在日誌中的錯誤:InstanceAgent ::插件:: CodeDeployPlugin :: CommandPoller:缺少憑據 - 請檢查是否這種情況下啓動與IAM實例配置文件 – hkguile
這將做到這一點也。你的部署沒有成功,因爲你沒有權限部署給他們...他們都失敗了。 –