Server-side configuration
1. Check if NFS is installed
Rpm-qa|grep NFS
Rpm-qa|grep Rpcbind
Without this installation nfs-utils and Rpcbind
Yum Install nfs-utils Rpcbind
2. Set up boot service
Chkconfig NFS On
Chkconfig Rpcbind on
3. Start related services
Service Rpcbind Start
Service NFS Start
4. Create a shared directory
Mkdir-p/export/primary
Mkdir-p/export/secondary
or create your own directory directly under each user, such as Nfsdir
/home/yanghg/nfsdir
/home/yaogl/nfsdir
/home/huangy/nfsdir
/home/wangw/nfsdir
/home/duh/nfsdir
/home/yuy/nfsdir
5. Edit the/etc/exports file to add the following:
/export* (Rw,async,no_root_squash,no_subtree_check)
/home/yanghg/nfsdir * (Rw,sync,no_root_squash)
/home/yaogl/nfsdir * (Rw,sync,no_root_squash)
/home/huangy/nfsdir * (Rw,sync,no_root_squash)
/home/wangw/nfsdir * (Rw,sync,no_root_squash)
/home/duh/nfsdir * (Rw,sync,no_root_squash)
/home/yuy/nfsdir * (Rw,sync,no_root_squash)
6. Refresh configuration takes effect immediately
Exportfs-a
>>> can now authenticate to your client
>>> take my platform as an example, execute mount-t nfs-o nolock 192.168.1.12:/home/yanghg/nfsdir/mnt
Client Configuration
1. Installing Nfs-utils and Rpcbind
Yum Install nfs-utils Rpcbind
2. Set up boot service
Chkconfig NFS On
Chkconfig Rpcbind on
3. Start the service
Servicerpcbind start
Servicenfs start
4. Create a mount point
Mkdir-p/mnt/primary
Mkdir-p/mnt/secondary
5. Mount Directory
Mount-t NFS Server_ip:/export/primary/mnt/primary
Mount-t NFS Server_ip:/export/secondary/mnt/secondary
6. View the mounted directory
Df-h
7. Unmount the mounted Directory
Umount/mnt/primary
Umount/mnt/secondary
8. Edit/etc/fstab, boot auto MountVi/etc/fstab
Server_ip:/export/primary/mnt/primary NFS Rw,tcp,intr 0 1
Server_ip:/export/secondary/mnt/secondary NFS Rw,tcp,intr 0 1
The Curve setting method on CentOS 6.8 for different users on NFS service