Score:1

Mounting EC2 directory with existing data to Fargate container using EFS

gr flag

I have an EC2 instance with a huge directory(ex. /large-dir) that containers need to access. Both instance and container share same network and security group. I'm able create and mount an EFS to container as well as add/remove files from the EFS after it is mounted.

On the instance there are processes that constantly write to /large-dir, so I cannot rename or move this directory.

At the moment I cannot mount EFS on the EC2 instance because that kind of overwrites directory data with EFS data(which is empty)

This would be easy if I was setting up from scratch(Initial empty dir on EC2 -> Mount EFS on EC2 -> Start processes that write to dir/efs -> Containers spin up randomly and mount the efs and have access to data on EC2)

Is there a way to sync the /large-dir on EC2 with EFS so any modifications are automatically available to the EFS and therefore available to containers that mount it?

mreferre avatar
nl flag
This may be something you can use to sync your EC2 directory with EFS: https://aws.amazon.com/blogs/aws/efs-file-sync-faster-file-transfer-to-amazon-efs-file-systems/
cn flag
Can you not interrupt the processes at all to copy the data? Even for a few minutes? This feels like a big operational issue waiting to happen - what happens if there's an unscheduled outage and the directory disappears?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.