I have two ec2 instance running Ubuntu 18.04. I have created a Provisioned IOPS SSD (io1) volume and enabled multi-attach. I have successfully mounted the volume on both instances and can read and write to it without any issues. The problem now is if I modify a file on the shared volume from instance A, I cannot see the change on instance B without remounting the volume. Is there a way to make those updates immediately visible on both instances?
Asked
Active
Viewed 674 times
5
-
1You can do that? TIL – user253751 Jan 18 '21 at 14:41
-
*I have successfully mounted the volume on both instances and can read and write to it without any issues.* No, you didn't. If you used something like XFS or any other *non*-shared filesystem, you just haven't noted any issues. ***YET***. – Andrew Henle Jan 18 '21 at 16:04
-
@AndrewHenle Figured as much. – codemonkey Jan 18 '21 at 17:16
1 Answers
7
You'll need a filesystem / app that's multi-attach aware. For example Oracle RAC can use such volumes, while normal filesystems like ext4
or xfs
can't. They are designed to be mounted on a single host only.
Let's step back - what are you trying to achieve? Share files between the instances I suppose? Your best bet is EFS (Elastic File System) - an AWS cloud-native NFS service. Unless you've got a very specific need for multi-attach EBS and running some very special app that can make use of that I suggest you explore the EFS way instead. The need for multi-attach disks is rare, both in the cloud and outside.
Hope that helps :)

MLu
- 24,849
- 5
- 59
- 86
-
1That's precisely what I need so EFS seems to fit the bill by its definition. I thought multi-attach works like an NFS. Thank you for disabusing me of that notion. – codemonkey Jan 17 '21 at 21:48
-
@codemonkey You probably want to check the filesystem you mounted from two instances at once. There are good chances it has been corrupted if you were using a filesystem which thought it had exclusive access to the volume (as most do). – jcaron Jan 18 '21 at 14:04