3 EXPORT_OPTS=${EXPORT_OPTS:-"rw,async,no_root_squash"}
8 local LUSTRE_CLIENT=${3}
10 local nfs_climntpt=${5:-$MNTPNT}
12 local export_opts_v=$EXPORT_OPTS
14 echo "Exporting Lustre filesystem..."
16 if [ "$NFS_VER" = "4" ]; then
17 export_opts_v="$EXPORT_OPTS,fsid=0"
18 do_nodes $LUSTRE_CLIENT "mkdir -p /var/lib/nfs/v4recovery"
21 do_nodes $LUSTRE_CLIENT,$NFS_CLIENTS "grep -q rpc_pipefs' ' /proc/mounts ||\
22 { mkdir -p /var/lib/nfs/rpc_pipefs && \
23 mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs; }" || return 1
26 do_nodes $LUSTRE_CLIENT "chkconfig --list nfsserver > /dev/null 2>&1 &&
27 service nfsserver restart ||
28 service nfs restart" || return 1
30 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
31 grep -q rpcidmapd && service rpcidmapd restart ||
34 do_nodes $LUSTRE_CLIENT "exportfs -o $export_opts_v *:$MNTPNT \
35 && exportfs -v" || return 1
37 echo -e "\nMounting NFS clients (version $NFS_VER)..."
39 do_nodes $NFS_CLIENTS "mkdir -p $nfs_climntpt" || return 1
40 if [ "$NFS_VER" = "4" ]; then
41 do_nodes $NFS_CLIENTS \
42 "mount -t nfs$NFS_VER -o async \
43 $LUSTRE_CLIENT:/ $nfs_climntpt" || return 1
45 do_nodes $NFS_CLIENTS \
46 "mount -t nfs -o nfsvers=$NFS_VER,async \
47 $LUSTRE_CLIENT:$MNTPNT $nfs_climntpt" || return 1
54 local LUSTRE_CLIENT=${2}
55 local NFS_CLIENTS=${3}
57 echo -e "\nUnmounting NFS clients..."
58 do_nodes $NFS_CLIENTS "umount -f $MNTPNT" || true
60 echo -e "\nUnexporting Lustre filesystem..."
61 do_nodes $NFS_CLIENTS "chkconfig --list rpcidmapd 2>/dev/null |
62 grep -q rpcidmapd && service rpcidmapd stop ||
65 do_nodes $LUSTRE_CLIENT "chkconfig --list nfsserver > /dev/null 2>&1 &&
66 service nfsserver stop || service nfs stop" ||
69 do_nodes $LUSTRE_CLIENT "exportfs -u *:$MNTPNT"
71 do_nodes $LUSTRE_CLIENT "exportfs -v"