From bbefeffafe9a2a5ba493e4bc0c9c9480d577e881 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 9 Aug 2013 14:17:33 +0200 Subject: nfs: persistent caching of connected NFS-clients Introduce /var/lib/glusterfs/nfs/rmtab to contain a list of NFS-clients which have a volume mounted. The volume option 'nfs.mount-rmtab' can be set to an alternative filename. When the file is located on shared storage, multiple gNFS servers can use the same file to present a single NFS-server. This cache is read when a system administrator calls 'showmount -a' and updated when an NFS-client calls MNT or UMNT from the MOUNT protocol. Usage: - create a volume for storing the shared rmtab file - mount the volume on all storage servers, at the same location - make sure that the volume is mounted at boot (add to /etc/fstab) - place the rmtab file on the volume: # gluster volume set nfs.mount-rmtab / - any subsequent mount requests will add an entry to this file - 'showmount -a' requests will return the NFS-clients using the cluster Note: The NFS-server does currently not support reconfigure(). When a configuration option is set/changed, the NFS-server glusterfs process gets restarted. This causes the active NFS-clients to be forgotten (the entries are saved in the old rmtab, but we do not have a reference to that file any more, so we can't re-add them). Therefor a re-mount done by the NFS-clients is needed before they get listed in the rmtab again. Change-Id: I58f47135d60ad112849d647bea4e1129683dd2b3 BUG: 904065 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/4430 Tested-by: Gluster Build System Reviewed-by: Harshavardhana Tested-by: Harshavardhana Reviewed-by: Rajesh Joseph --- xlators/nfs/server/src/mount3.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/nfs/server/src/mount3.h') diff --git a/xlators/nfs/server/src/mount3.h b/xlators/nfs/server/src/mount3.h index b9721fc0..981869bf 100644 --- a/xlators/nfs/server/src/mount3.h +++ b/xlators/nfs/server/src/mount3.h @@ -53,6 +53,9 @@ mnt1svc_init (xlator_t *nfsx); extern int mount_init_state (xlator_t *nfsx); +void +mount_rewrite_rmtab (struct mount3_state *ms, char *new_rmtab); + /* Data structure used to store the list of mounts points currently * in use by NFS clients. */ -- cgit