I have a problem with NFS that I can't start to resolve. All servers are CentOS 5 servers. One server exports a directory and two others mount it. Simple so far.
A file is created on the server, and the two nfs clients do an "ls -al" and get a common (meaning the same) result as the server. Over the course of a day, and after the file on the server has been modified on the server, the results of the "ls -al" show the original common result on the two clients, and an obviously different result on the server. So I figure it's some kind of caching problem. But I figure it's a server caching problem.
I next go to one of the clients and "cat" the file, and then do another "ls -al". Now the server and this client agree on the file attributes, but not on the second client which shows the original wrong result still. So now I think it's a client caching problem.
Can anyone explain the above situation and perhaps some settings that will resolve this without requiring the nfs client to open the file in some way before it gets the proper file attributes?
"nfsstat -m" of the client returns the following:
Flags: rw,vers=3,rsize=32768,wsize=32768,acregmax=3,acdirmin=3,acdirmax=3,hard, intr,proto=tcp,timeo=600,retrans=2,sec=sys,addr=10.0.12.152
Thanks for any help.
Steve Campbell
On Tue, May 20, 2008 at 8:22 AM, Steve Campbell campbell@cnpapers.com wrote:
I next go to one of the clients and "cat" the file, and then do another "ls -al". Now the server and this client agree on the file attributes, but not on the second client which shows the original wrong result still. So now I think it's a client caching problem.
Can anyone explain the above situation and perhaps some settings that will resolve this without requiring the nfs client to open the file in some way before it gets the proper file attributes?
Try explicitly adding "noac" (no attribute caching) to the mount definition in /etc/fstab. If you're doing this as an autofs mount, it goes in /etc/auto.* somewhere, with a slightly different syntax.
Bart Schaefer wrote:
On Tue, May 20, 2008 at 8:22 AM, Steve Campbell campbell@cnpapers.com wrote:
I next go to one of the clients and "cat" the file, and then do another "ls -al". Now the server and this client agree on the file attributes, but not on the second client which shows the original wrong result still. So now I think it's a client caching problem.
Can anyone explain the above situation and perhaps some settings that will resolve this without requiring the nfs client to open the file in some way before it gets the proper file attributes?
Try explicitly adding "noac" (no attribute caching) to the mount definition in /etc/fstab. If you're doing this as an autofs mount, it goes in /etc/auto.* somewhere, with a slightly different syntax.
Bart,
Thanks for the suggestion, but still no go. New client says the following:
Flags: rw,sync,vers=3,rsize=32768,wsize=32768,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0, hard,intr,noac,proto=tcp,timeo=600,retrans=2,sec=sys,addr=10.0.12.152
We do have a client mounted on a different server using version 4. It seems to keep up with the attributes, but we haven't tested it much yet.
Does anyone have opinions on version 4 and what should I be aware of?
Off to googleland.
Steve