Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

first time here posting, i hope i won't do many mistakes.

I've a setup with 2 NFS server. They're using corosync/pacemaker + drbd to offer active/passive nfs server. Distro used is Ubuntu latest LTS version.

Cluster is also offering a floating ip for clients to connect. Volume replication works fine.

The problem is that during the failover the i/o operations wait for approx 90 seconds. After failover (with the new machine already promoted as new master) tcpdump on the client shows packets like:

reply ok 52 getattr ERROR: unk 10013

Looking for Error 10013 and nfs on google leaded me to this usenet post

So my locks are retained to the nfs server and only after 90 sec they're freed. I need to lower that parameter (contained in /proc) but when i try

root@nfs-ha-1:/# ls -l /proc/fs/nfsd/nfsv4gracetime
-rw------- 1 root root 0 Jan 31 11:00 /proc/fs/nfsd/nfsv4gracetime
root@nfs-ha-1:/# cat /proc/fs/nfsd/nfsv4gracetime
90
root@nfs-ha-1:/# echo 1 > /proc/fs/nfsd/nfsv4gracetime
bash: echo: write error: Device or resource busy
root@nfs-ha-1:/#

So i'm need of further info about this issue, or a way to write on that file. The files are created at run time with nfs-server. If i stop the nfsserver they directory is simply empty, and i cannot write to it.

root@nfs-ha-1:/proc/fs/nfsd# touch nfsv4gracetime
touch: cannot touch `nfsv4gracetime': No such file or directory
share|improve this question
    
Seems to be a lot of people asking similar questions. Most responses seem to be that setting the grace time too low, will cause stability/data consistency issues. –  Steve Jan 31 '13 at 10:53
    
Thank you for your input, Steve. Probably HA is an hot topic. Especially when done with DRBD it can save a lot of bucks (no expensive storage). BTW i just need a way to write to that file –  Andrea Jan 31 '13 at 11:01
    
Yeah i had a quick google around, most people seem to be able to edit that file without issue, so im not sure whats causing your issues, sorry i cant be more help. –  Steve Jan 31 '13 at 11:09
add comment

1 Answer 1

I want to make this follow up to explain what was the problem and how to solve it. The parameters can be modified only at certain moments.

If you try to write on /proc/fs/nfsd with the nfs-kernel stopped (module unloaded) the file are simply not existant. If you try after launching the nfs-kernel you'll get the device busy error.

The solution is to edit the init script for nfs-kernel-server and modify the parameters (through the usual echo on the needed files) after the modprobe of the module.

So you need to to write the parameters between the do_modprobe and do_mount directive.

Sample from /etc/init.d/nfs-kernel-server of ubuntu 12.04 LTS

# See how we were called.
case "$1" in
  start)
        if [ -f /etc/exports ]
        then
                do_modprobe nfsd
                echo 15 > /proc/fs/nfsd/nfsv4leasetime
                echo 25 > /proc/fs/nfsd/nfsv4gracetime

                # See if our running kernel supports the NFS kernel server
                if ! grep -E -qs "[[:space:]]nfsd\$" /proc/filesystems; then
                        log_warning_msg "Not starting $DESC: no support in current kernel."
                        exit 0
                fi
                do_mount nfsd $PROCNFSD_MOUNTPOINT || NEED_SVCGSSD=no
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.