[Unionfs] disable unionfs cache?
Pásztor Lénárd Zoltán
lenard.pasztor at gmail.com
Mon Jul 16 05:06:55 EDT 2007
> Lenard, what version of Unionfs have you been using? I assume by "newest"
> you mean something in which we added the mtime-based cache-coherency
> support. Are you? All of our recent releases include that automatic
> cache-coherency support.
v2.0, 2.6.22.1-u1
>
>
> One possibility is that you mount unionfs on top of nfs mounts, and the
> nfs
> mounts don't reflect server-side changes fast enough for you? This would
> be
> an NFS issue, since it caches attributes from the server onto the client,
> and doesn't purge them frequently enough. In that case, I'd recommend
> that
> you mount all of your NFS mounts with "-o noac" (No Attribute Cache), or
> play with the four options ac{reg,dir}{min,max}.
>
> In other words, if the lower file system doesn't see new objects' data and
> attributes (esp. mtime/ctime), then Unionfs, sitting above, cannot see
> them
> either -- thus you have to first make the lower file systems see the
> updated
> file attributes.
My test config:
2 nfs servers loadbalanced via LVS. Backend filesystem is ocfs2 on top of a
drbd 0.8. block device (primary/primary config)
This is for HA.
Clients have an initrd. Initrd mounts the root filesystem.
NFS related kernel command line opions:
nfsroot=10.0.3.2:/storage,soft,noac
#nfs root mounted by kernel internally at boot time (autoconfig):
nfs:/storage /root nfs
ro,sync,vers=3,rsize=8192,wsize=8192,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,soft,noac,nolock,proto=tcp,timeo=7,retrans=3,sec=sys,addr=
10.0.3.2 0 0
# local storage for write support
/dev/disk/by-label/local /union_local ext3 rw,data=ordered 0 0
# 'new' root filesystem by unionfs (mounted by initrd)
unionfs / unionfs
rw,dirs=/union_local=rw:/root/layers/by-host/app1=ro:/root/layers/by-role/app=ro:/root/systems/current=ro
0 0
There is only one nfs export ( /storage ), but the union branches has 3 nfs
layer. This layers are in the same nfs mount's sub directories.
The nfs export (/storage) hierarchy:
/layers
/layers/by-host/app1
/layers/by-host/app1/etc
/layers/by-host/app1/etc/hostname "app1"
/layers/by-role/app
/layers/by-role/app/etc
/layers/by-role/app/etc/hostname "app"
/systems
/systems/current/
/systems/current/bin
/systems/current/boot
/systems/current/dev
...
/systems/current/etc/hostname "base-system"
...
For testing all layer has the /etc/hostname file.
The local storage is empty ext3 filesystem.
So, when the client boots it sets the hostname from by-host branch to
"app1".
(nfs)$cat /storage/layers/by-host/app1/etc/hostname
app1
(client)$cat /etc/hostname
app1
# from /storage/layers/by-host/app1/etc/hostname. It's ok.
(nfs)$echo "xyz" > /storage/layers/by-host/app1/etc/hostname
(nfs)$cat /storage/layers/by-host/app1/etc/hostname
xyz
(client)$cat /etc/hostname
app1
# It not changed on client side. :(
(server)$rm /storage/layers/by-host/app1/etc/hostname
# source deleted from by-host branch
(client)$cat /etc/hostname
app
# from /storage/layers/by-role/app/etc/hostname. It's ok.
(nfs)$echo "xyz" > /storage/layers/by-host/app1/etc/hostname
# the /storage/layers/by-host/app1/etc/hostname now exists
(client)$cat /etc/hostname
app
# client site not changed :(
(server)$rm /storage/layers/by-role/app/etc/hostname
(client)$cat /etc/hostname
xyz
# from /storage/layers/by-host/app1/etc/hostname. It's ok.
--
thx,
Lénárd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.fsl.cs.sunysb.edu/pipermail/unionfs/attachments/20070716/ac9ae442/attachment.htm
More information about the unionfs
mailing list