Installation: [root @ localhostetc] # rpm-qa | grepnfsnfs-utils-lib-1.1.5-6.el6.i686nfs4-acl-tools-0.3.3-6.el6.i686nfs-utils-1.2.3-36.el6.i686 [root @ localhostetc] # rpm-qa | greprpcbindrpcbind-0.2.0-11.el6.i6 installation:
[Root @ localhost etc] # rpm-qa | grep nfs
Nfs-utils-lib-1.1.5-6.el6.i686
Nfs4-acl-tools-0.3.3-6.el6.i686
Nfs-utils-1.2.3-36.el6.i686
[Root @ localhost etc] # rpm-qa | grep rpcbind
Rpcbind-0.2.0-11.el6.i686
[Root @ localhost etc] #
If the above two software are not installed, you can use yum for online installation.
Configuration:
Main configuration file:/etc/exports
[Root @ localhost/] # vi/etc/exports
/Tmp 192.168.0.0/24 (rw) // Share "/tmp" to the 192.168.0.0 CIDR block (readable ).
/Tmp 192.168.0.65 (rw, sync, no_root_squash) // Share "/tmp" with 192.168.0.65 (readable and writable, synchronous ).
[Root @ localhost etc] # service portmap restart
Stop portmap: [OK]
Start portmap: [OK]
[Root @ localhost etc] # service nfs restart // restart the service after the configuration is complete
Disable NFS mountd: [OK]
Disable the NFS daemon: [OK]
Disable NFS quotas: [OK]
Disable NFS: [failed]
Start the NFS service: [OK]
Disable NFS quota: [OK]
Start the NFS daemon: [OK]
Start NFS mountd: [OK]
[Root @ localhost etc] # showmount-e // view your shared services
Export list for localhost. localdomain:
/Tmp 192.168.0.0/24, localhost
[Root @ localhost tmp] # showmount-a // displays the directory information that has been connected to the client
All mount points on localhost. localdomain:
192.168.0.213:/tmp
======================================
Client connection:
# Showmount-e 192.168.0.248 // list available NFS
Export list for 192.168.0.248:
/Tmp 192.168.0.65, 192.168.0.213
# Mount 192.168.0.248:/tmp/mnt // mount the "/tmp" directory to "/mnt.
========================================================== ==========================================
NFS mounting error:
# Mount 192.168.0.70:/tmp/mnt/tmp
Mount: 1831-008 discard:
192.168.0.70:/tmp
Vmount: The operation is not allowed.
# Nfso-p-o nfs_use_reserved_ports = 1
Setting nfs_use_reserved_ports to 1
Setting nfs_use_reserved_ports to 1 in the nextboot file
# Mount 192.168.0.70:/tmp/mnt/tmp
# Ls/mnt/tmp