Reputation: 3371
I have attached an EBS (elastic block storage) volume to two EC2 instances to achieve a requirement where one ec2 instance performs some actions and creates files in the volume in specific directory and other ec2 instance uses these file to do some further actions. However it is not working as expected, the files and directories created on from first ec2 are not showing in same volume when accessed through another ec2. It there anything I am missing. Please suggest how it can be done if its not the correct way.
Upvotes: -1
Views: 129
Reputation: 270089
It is unlikely you will see files copied between instances because the default file systems aren't designed to be mounted on multiple computers simultaneously.
From Attach a volume to multiple instances with Amazon EBS Multi-Attach - Amazon EBS:
Standard file systems, such as XFS and EXT4, are not designed to be accessed simultaneously by multiple servers, such as EC2 instances. You should use a clustered file system to ensure data resiliency and reliability for your production workloads.
Frankly, if you want to share data because instances, you might find it easier to use Amazon EFS:
Amazon Elastic File System (Amazon EFS) provides serverless, fully elastic file storage so that you can share file data without provisioning or managing storage capacity and performance. Amazon EFS is built to scale on demand to petabytes without disrupting applications, growing and shrinking automatically as you add and remove files.
Or, you could store the files in an Amazon S3 bucket and access them from multiple instances.
Upvotes: 5