NFSv4.r (or rnfs) is an extention to the standard NFSv4 protocol that supports mutable replication with consistency guarantees. The extention includes kernel patches for linux-2.6.16-rc3 and user-level patches for CITI nfs-util-1.0.8-rc2 package. The code is useable for experimental setup, but not stable yet for production use. If anyone is interested in getting involved with the project, I will be very happy to discuss details on how to work together. Of course, any comments and suggestions are always welcome. I. Installation (assume as root) 1. Kernel build 1.1 Download linux-2.6.16-rc3 kernel from http://www.kernel.org/ wget http://www.kernel.org/pub/linux/kernel/v2.6/testing/linux-2.6.16-rc3.tar.gz tar zxvf linux-2.6.16-rc3.tar.gz 1.2 Download and apply CITI kernel patch and rnfs patch cd linux-2.6.16-rc3 wget http://www.citi.umich.edu/u/jiaying/NFSv4.r/linux-2.6.16-rc3-patches/CITI_NFS4_ALL-1.diff.patch patch -p1 < CITI_NFS4_ALL-1.diff.patch wget http://www.citi.umich.edu/u/jiaying/NFSv4.r/linux-2.6.16-rc3-patches/rnfs-all.patch patch -p1 < rnfs-all.patch 1.3 Build kernel make menuconfig; make; make install; make modules_install 2. User-level helper build 2.1 Download and build the packages that nfs-utils-1.0.8-rc2 relies on wget http://monkey.org/~provos/libevent-1.0b.tar.gz tar zxvf libevent-1.0b.tar.gz cd libevent-1.0b; ./configure; make; make install wget http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/libnfsidmap-0.19.tar.gz tar zxvf libnfsidmap-0.19.tar.gz cd libnfsidmap-0.19/; ./configure; make; make install wget http://www.citi.umich.edu/projects/nfsv4/linux/libgssapi/libgssapi-0.10.tar.gz tar libgssapi-0.10.tar.gz cd libgssapi-0.10/; ./configure; make; make install wget http://www.citi.umich.edu/projects/nfsv4/linux/librpcsecgss/librpcsecgss-0.14.tar.gz tar tar zxvf librpcsecgss-0.14.tar.gz cd librpcsecgss-0.14; ./configure; make; make install 2.2 Download nfs-utils-1.0.8 (a package is provided here) wget http://www.citi.umich.edu/u/jiaying/NFSv4.r/nfs-utils-1.0.8-rc2.tar.gz tar zxvf nfs-utils-1.0.8-rc2.tar.gz 2.2 Download and apply CITI nfs-utils patch and rnfs patch cd nfs-utils-1.0.8-rc2 wget http://www.citi.umich.edu/u/jiaying/NFSv4.r/nfs-utils-patches/CITI_NFS4_ALL-2.dif.patch patch -p1 < CITI_NFS4_ALL-2.dif.patch wget http://www.citi.umich.edu/u/jiaying/NFSv4.r/nfs-utils-patches/rnfs-util.patch patch -p1 < rnfs-util.patch 2.3 Build nfs-utils ./configure; make; make install II. Running 1. Setup replica lookup method. Currently, we support DNS, LDAP, File configuration, and Server Redirect. For example, to set up File configuration, create a file /etc/nfs-replica.conf: rnfs.test server1:/test -fstype=nfs4,rw,proto=tcp,rsize=32768,wsize=32768,intr rnfs.test server2:/test2 -fstype=nfs4,rw,proto=tcp,rsize=32768,wsize=32768,intr In the file, each line contains "lookup-key server:/path mount-options" 2. Start nfsd on nfsv4 replication servers. Give a special option fs_loc with exportfs. Make sure the replicated directory is identical on replication servers (e.g., run rsync before starting nfsd) rpc.mountd & rpc.idmapd rpc.rnfsd & rpc.nfsd 8 mount --bind /nfs4/test /export/test exportfs -ofsid=0,rw,insecure,no_subtree_check *:/export exportfs -orw,insecure,nohide,no_subtree_check,async,fs_loc="file://etc/nfs-replica.conf:/rnfs.test" *:/export/test 3. Mount nfs on client and start using it mount -t nfs4 server1:/ /mnt/nfs4 ls /mnt/nfs4/test // this is the replicated directory 4. Use -l option with umount to un-mount all mount points umount -l /mnt/nfs4 Author: Jiaying Zhang