简体   繁体   English

如何将 ebs 卷(或部分)挂载到 Fargate 容器

[英]How to mount ebs volume(or part) to fargate container

I'm using ECS Fargate to host containers in a service.我正在使用 ECS Fargate 在服务中托管容器。 The service is tied to the target group in order to load balance.该服务绑定到目标组以实现负载平衡。 https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-storage.html https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-task-storage.html

This link mentions one can use EFS for persistent storage.此链接提到可以使用 EFS 进行持久存储。 IMO EFS is slow. IMO EFS 很慢。 EBS is faster and better. EBS 更快更好。 But I can't find a way to share EBS volume directly or indirectly(EBS attached to EC2) with a set on containers so all containers see the same data as well as can write to it and the storage persists even after the containers die但是我找不到直接或间接地与容器上的一组共享 EBS 卷(EBS 附加到 EC2)的方法,因此所有容器都可以看到相同的数据并且可以写入它并且即使在容器死后存储仍然存在

Is there a way to have common storage for all containers on Fargate(I don't mean ECS offering where tasks are hosted on EC2)?有没有办法为 Fargate 上的所有容器提供公共存储(我不是说 ECS 提供在 EC2 上托管任务的地方)?

There are a couple of things to unpack here: first and foremost today ECS/Fargate does not support mounting EBS volumes.这里有几件事要解压:首先,今天 ECS/Fargate 不支持挂载 EBS 卷。 This support is something we would like to introduce on but it's not available to date.这种支持是我们想要介绍的,但目前尚不可用。 Second, even though you were able to attach an EBS volume to a task, consider that EBS is block storage and so to be able to share its content with different systems (ECS/Fargate tasks in this case) you'd need to have some sort of clustered file system OR a software/logic that arbitrates access from one system only at a time.其次,即使您能够将 EBS 卷附加到任务,考虑到 EBS 是块存储,因此为了能够与不同的系统(在这种情况下为 ECS/Fargate 任务)共享其内容,您需要有一些一种集群文件系统或一种软件/逻辑,一次仅仲裁来自一个系统的访问。 When you say EFS is slow is because you have already tested it (and did not meet your requirements) or is this an assumption?当您说 EFS 很慢是因为您已经对其进行了测试(并且没有满足您的要求)或者这是一个假设?

What you are after is not supported.不支持您所追求的。 Solution switch to using EC2 rather than using Fargate.解决方案切换到使用 EC2 而不是使用 Fargate。

Docker volumes are only supported when using the EC2 launch type or external instances. Docker 卷仅在使用 EC2 启动类型或外部实例时受支持。

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-volumes.html#docker-volume-considerations https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-volumes.html#docker-volume-considerations

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM