cluster:Nfs/4/client
See also troubleshooting for this page.
Contents |
NFS client v.4
Prepare
- Operating system
- Scientific Linux version 5.6 64 bit
Optimizing the configuration:
Use minimal operating system installation without firewall. To verify installed packages use the command
-
rpm -qa | grep package_name
Install the following additional packages:
-
yum -y install wget yum rpm make gcc gcc-c++ tar sed zlib openssl
After the installation is complete, turn off any unnecessary services (like gpm, sendmail, cups, haldaemon, messagebus, pcmcia, anacron, atd) with the following command:
-
chkconfig <SERVICE> off
Configure the following settings for the server:
| Prepare new hard disk
|
- Firewall configuration
- configure TCP port 2049 for
nfs(how to open port in firewall). - configure TCP port 1111 for
portmapper(how to open port in firewall).
administrator's script: prepare.sh
#!/bin/bash# prepare the nfs client installation# Declare the variables section ------------# Please insert your actual configuration# NFS_SERVER_DIR="export directory on nfs server"# RIGHTS="access mode for export directory on the nfs server"# from here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~echo `su -`
NFS_SERVER_DIR="/srv/nfs"
RIGHTS="755"
# till here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#-> start routinemkdir -m ${RIGHTS} ${NFS_SERVER_DIR}
#<- end routine
Install
- Install the actual versions of
- nfs-utils
- portmap
- quota
- Create the mount directory
administrator's script: install.sh
#!/bin/bash# install nfs clientsource prepare.sh#-> start routineecho `su -`
yum -y install nfs-utils portmap quota
#<- end routine
Configure
- Configure the following files for the host access:
- Configure the following files for the NFS work:
- used on the NFS client
- used on the NFS client and server
| NFS client should mount the /srv/nfs directory, but some softlinks should point to the /srv/nfs subdirectories. For example:
|
administrator's script: configure.sh
#!/bin/bash# prepare the nfs client installation# Declare the variables section ------------# from here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~NFS_SERVER=dgireffs1# till here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#-> start routine# Configure /etc/sysconfig/nfs# This entry should be "yes" if you are using RPCSEC_GSS_KRB5 (auth=krb5,krb5i, or krb5p)SECURE_NFS="no"
# Check the /etc/gssapi_mech.conf[[ -f /etc/gssapi_mech.conf ]] && echo "OK" || exit
cat << EOF >> /etc/fstab
${NFS_SERVER}.${DOMAIN}:/ /srv/nfs nfs4 rw,hard,intr,proto=tcp,port=2049,noauto 0 0
EOF
#<- end routine
Proceed
- /etc/init.d/portmap - used on the client and server
- /etc/init.d/rpcidmapd - required on both client and server
- /etc/init.d/rpcgssd - required on the client when RPCSEC_GSS is used
administrator's script: proceed.sh
#!/bin/bash#-> start routinechkconfig --level 0123456 portmap offchkconfig --level 345 portmap on
chkconfig --level 0123456 rpcidmapd offchkconfig --level 345 rpcidmapd on
chkconfig --level 0123456 nfslock offchkconfig --level 0123456 nfs offchkconfig --level 0123456 rpcgssd offchkconfig --level 0123456 rpcsvcgssd off# Stop local firewallservice iptables stop
chkconfig --level 0123456 iptables off# stop services/etc/init.d/nfslock stop
/etc/init.d/nfs stop
/etc/init.d/rpcgssd stop
/etc/init.d/rpcsvcgssd stop
# start services/etc/init.d/portmap restart
/etc/init.d/rpcidmapd restart
# mount the nfs directorymount -v /srv/nfs
#<- end routine
Initial test
Try to examine the output from the following commands:
-
rpcinfo -pto check the rpc -
netstat -tunapto display the open ports for the applications
administrator's script: test.sh
#!/bin/bash#-> start routinerpcinfo -pprogram vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 727 status
100024 1 tcp 730 status
1073741824 1 tcp 48909
100011 1 udp 965 rquotad
100011 2 udp 965 rquotad
100011 1 tcp 968 rquotad
100011 2 tcp 968 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 32771 nlockmgr
100021 3 udp 32771 nlockmgr
100021 4 udp 32771 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 39151 nlockmgr
100021 3 tcp 39151 nlockmgr
100021 4 tcp 39151 nlockmgr
100005 1 udp 981 mountd
100005 1 tcp 984 mountd
100005 2 udp 981 mountd
100005 2 tcp 984 mountd
100005 3 udp 981 mountd
100005 3 tcp 984 mountd
netstat -tunap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:49126 0.0.0.0:* LISTEN -
tcp 0 0 0.0.0.0:968 0.0.0.0:* LISTEN 32164/rpc.rquotad
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 31182/portmap
tcp 0 0 0.0.0.0:984 0.0.0.0:* LISTEN 32181/rpc.mountd
udp 0 0 0.0.0.0:2049 0.0.0.0:* -
udp 0 0 0.0.0.0:32771 0.0.0.0:* -
udp 0 0 0.0.0.0:965 0.0.0.0:* 32164/rpc.rquotad
udp 0 0 0.0.0.0:981 0.0.0.0:* 32181/rpc.mountd
udp 0 0 0.0.0.0:111 0.0.0.0:* 31182/portmap
#<- end routine
Update
The direct way to update or delete the installed nfs rpm software package is to use the yum or rpm.
administrator's script: update.sh
#!/bin/bash# update#-> start routinesu -c 'yum update nfs-utils'
#<- end routine