大佬教程收集整理的这篇文章主要介绍了CloudFormation 无法启动 ECS 服务,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在夜间运行的 buildkite 管道期间,CloudFormation 无法创建 ECS 服务,超时。
超时的原因可能是什么?
@H_197_7@CFN 日志
@H_674_10@cfn INFO 03:08:51 CREATE_IN_PROGRESS build-amis-564-registrations: User Initiated
cfn INFO 03:08:56 CREATE_IN_PROGRESS TaskDeFinition
cfn INFO 03:08:59 CREATE_IN_PROGRESS TaskDeFinition: resource creation Initiated
cfn INFO 03:08:59 CREATE_COMPLETE TaskDeFinition
cfn INFO 03:09:02 CREATE_IN_PROGRESS ECSservice
ecs INFO 03:09:10 WaiTing for cluster to scale up. Please wait...
TraceBACk (most recent call last):
file ".buildkite/scripts/deploy/ecs_deploy.py",line 282,in <module>
main()
file ".buildkite/scripts/deploy/ecs_deploy.py",line 232,in main
ecs.wait_for_service_steady(cluster,stack_name,project_name,desired_count)
file "/app/ecs/__init__.py",line 680,in wait_for_service_steady
raise Exception("Timed out waiTing for service deployment")
Exception: Timed out waiTing for service deployment
@H_197_7@Python 脚本
摘自在 15 分钟后生成错误的 python 脚本(CloudFormation 本身在尝试创建服务三小时失败后继续超时)。
@H_674_10@...
for event in filter_events_response(response,last_event_ID) or []:
if "insufficIEnt memory" in event["message"]:
message = info("WaiTing for cluster to scale up. Please wait...")
else:
message = event["message"]
if log_progress:
logger.info(
"%s\t%s",event["createdAt"].strftime("%H:%M:%s"),message
)
last_event_ID = event["ID"]
waited = 0
if "steady" in event["message"]:
logger.deBUG(event)
return
if "deregistered" in event["message"]:
killed_tasks += 1
if killed_tasks > allowed_killed_tasks:
raise serviceUnstableException(
"%s-%s service tasks are failing to start"
% (stack,servicE)
)
time.sleep(20)
waited += 20
if waited > 900:
raise Exception("Timed out waiTing for service deployment")
...
解决方案:删除之前创建的 CloudFormation 堆栈。
一旦之前由 Buildkite 管道创建的所有堆栈都被清除,管道就可以正常运行。
最好的建议是在您的管道中添加一个步骤,以便在无法构建所有堆栈时删除所有堆栈。
以上是大佬教程为你收集整理的CloudFormation 无法启动 ECS 服务全部内容,希望文章能够帮你解决CloudFormation 无法启动 ECS 服务所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。