Server-side 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 related services
Service Rpcbind Start
Service NFS Start
4. Create a shared directory
Mkdir-p/export/primary
Mkdir-p/export/secondary
5. Edit the/etc/exports file to add the following:
Vi/etc/exports
/export* (Rw,async,no_root_squash,no_subtree_check)
6. Refresh configuration takes effect immediately
Exportfs-a
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 mount
Vi/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
CentOS Configuration NFS Service detailed steps (CentOS Open NFS Service)