Sharing a Read-only file system
Submitted by webmaster on Tue, 05/27/2008 - 09:43.
A PersistentFS file system can be directly mounted read-only as many computers as desired.
At some point, it may be necessary to update the files on the read-only file system. PersistentFS does not support changing or writing to a file system from one computer while it is mounted read-only on another computer. There are however two basic approaches that can be used to update a read-only file system:
Method 1 for changing a shared, read-only file system:
- Dismount the read-only file system from all computers.
- Mount the file system read-write on one computers.
- Make changes to the file system contents.
- When done, dismount the file system and wait for the persistentfs process to complete.
- Remount the file system read-only on multiple computers.
Method 2 for changing a shared, read-only file system:
- Create a new file system in a different bucket or a different S3KeyPrefix.
- On an Amazon EC2 instance, mount the new file system read-write and mount the old file system read-only.
- Copy everything over from the old file system to the new file system ("rsync -Pa").
- Make changes on the new file system.
- When done, dismount the new file system and wait for the persistentfs process to complete.
- Either:
(a) Mount the new file system read-only on your existing computers and tell your applications to switch to the new file system;
or, if using the file system from Amazon EC2, (b) Launch new EC2 instances that use the new file system (you could pass the bucket name and S3KeyPrefix in the instance's launch data), then switch your application from using the old EC2 instances to the new instances (you can do this from a load balancer, proxy server, DNS, or by reassigning Elastic IP addresses), and when everything has switched over, terminate the old instances. - Either:
(a) Delete the old file system;
or (b) Save the old file system and use it the next time you want to make changes ("rsync -Pa" will run very quickly if most of the files are already in the file system).
»
- Login to post comments
