首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >亚马逊网络服务CodePipeline无法将EFS附加到多集装箱码头弹性豆茎

亚马逊网络服务CodePipeline无法将EFS附加到多集装箱码头弹性豆茎
EN

Stack Overflow用户
提问于 2020-04-28 00:33:36
回答 1查看 82关注 0票数 0

我使用亚马逊网络服务CodePipeline在Elastic Beanstalk上部署一个多容器码头应用程序。该应用程序需要将EFS中的文件系统附加为已挂载的卷。为了连接并访问卷,我似乎需要重新启动docker。这在这个问题中得到了解释:Using AWS EFS with Docker。虽然我可以根据这些说明成功附加文件系统,但我的部署有时会“失败”,并显示以下错误:

代码语言:javascript
复制
Action execution failed Deployment completed, but with errors: ECS task stopped due to: Task failed to start.  Failed to start ECS task: arn:aws… is STOPPED.

在这些情况下,应用程序成功部署,并且功能完全正常,但我收到一条失败消息,因为docker在检查过程中尚未重新启动。

发生这种情况时,我在Beanstalk日志中看到以下内容:

代码语言:javascript
复制
-------------------------------------
/var/log/ecs/ecs-init.log
-------------------------------------
2020-04-27T15:06:41Z [INFO] pre-start
2020-04-27T15:06:44Z [INFO] start
2020-04-27T15:06:44Z [INFO] No existing agent container to remove.
2020-04-27T15:06:44Z [INFO] Starting Amazon Elastic Container Service Agent
2020-04-27T15:07:20Z [INFO] Agent exited with code 0
2020-04-27T15:07:20Z [INFO] Error connecting to docker, backing off for 1.14777941s, error: Get http://unix.sock/v1.25/version: dial unix /var/run/docker.sock: connect: no such file or directory
2020-04-27T15:07:21Z [INFO] Error connecting to docker, backing off for 2.282153551s, error: Get http://unix.sock/v1.25/version: dial unix /var/run/docker.sock: connect: no such file or directory
2020-04-27T15:07:23Z [INFO] post-stop
2020-04-27T15:07:23Z [INFO] Cleaning up the credentials endpoint setup for Amazon Elastic Container Service Agent
2020-04-27T15:07:23Z [INFO] pre-start
2020-04-27T15:07:23Z [INFO] start
2020-04-27T15:07:23Z [INFO] Container name: /ecs-agent
2020-04-27T15:07:23Z [INFO] Removing existing agent container ID:
2020-04-27T15:07:23Z [INFO] Starting Amazon Elastic Container Service Agent

有没有办法防止这些错误的失败?

EN

回答 1

Stack Overflow用户

发布于 2020-04-28 22:31:39

问题似乎是当ecs-agent启动时docker守护进程没有运行。Elasticbeanstalk有自己的方式来管理docker守护进程和ecs-agent启动,除非它是手动/自动干预的。

您能否确认是否通过任何EB扩展重新启动docker/ecs-agent,因为它可能会阻碍EB正常的引导过程?

如果您正在使用EB扩展来启动/重新启动docker,请在'post-deploy‘阶段使用不会影响引导过程的'hooks’来执行此操作。这里是您可以使用的常见钩子1。在此链接2上也给出了一些示例。

参考文献:

1

2

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61463728

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档