1

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?

Rohini
  • 45
  • 4
  • 1
    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/ – mreferre Dec 31 '21 at 16:07
  • 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? – shearn89 Jan 06 '22 at 16:16

0 Answers0