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?
-
1You can do that? TIL– user253751Jan 18, 2021 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 HenleJan 18, 2021 at 16:04
-
@AndrewHenle Figured as much.– codemonkeyJan 18, 2021 at 17:16
1 Answer
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 :)
-
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. Jan 17, 2021 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).– jcaronJan 18, 2021 at 14:04