How to refresh shared file system on shared LVM in SAN
I want to share the file system between two servers which are connected to Network attached storage(NAS). I am using RHEL 5.0 in my servers. For this I have done following things till now:
1. Created one logical volume(LV)in NAS back-end. Created 'ext3' file system on it after making it available(lvchange -ly). Then mounted in my server1 like:
mount -o rw,sync,dirsync <lv>
B'cz I want to write directly to disk not to write-cache.
2. Next in my server2, I made available the that LV(lvchange -ay) & mounted the file system like:
mount -o ro,sync <lv>
B'cz I don't want to allow anybody to write from server2.
I am able to see the shared file system on both but problem comes while I write something on shared file system from server1 is not visible to server2 immediately.
So I tried followings:
1. Unmount & mount again & I am able to see the changes. But my requirement is to refresh file system online(without unmounting).
2. Run e2fsck -F <lv> on server2. But e2fsck is not safe in mounted file system & internally it does unmount/mount.
3. So I tried with 'sync' & 'echo 3 > /proc/sys/vm/drop_cache' on server2. The file system is getting refreshed but in inconsistent manner. Some times it takes long time or requires to fire those commands multiple times. The flushing of read-cache is not becoming consistent.
If I use GFS with Logical Volume, will building Source rpm of GFS will be sufficient or need kernel compilation for cluster logical volume daemon(clvm)?
So, I am looking for something which can stabilize my filesystem refresh. I am happy with little delay.
Can anybody please help me?