环境
- Red Hat Enterprise Linux 7
问题
- How do I configure NFS in RHEL 7?
- How do I enable the NFS service in RHEL 7?
决议
- Install NFS packages on the system using the following command:
Raw
# yum install nfs-utils rpcbind
- Enable the services at boot time:
Raw
# systemctl enable nfs-server # systemctl enable rpcbind # systemctl enable nfs-lock <-- In RHEL7.1 (nfs-utils-1.3.0-8.el7) this does not work (No such file or directory). it does not need to be enabled since rpc-statd.service is static. # systemctl enable nfs-idmap <-- In RHEL7.1 (nfs-utils-1.3.0-8.el7) this does not work (No such file or directory). it does not need to be enabled since nfs-idmapd.service is static.
- Start the NFS services:
Raw
# systemctl start rpcbind # systemctl start nfs-server # systemctl start nfs-lock # systemctl start nfs-idmap
- Check the status of NFS service:
Raw
# systemctl status nfs
- Create a shared directory:
Raw
# mkdir /test
- Export the directory:
Raw
# vi /etc/exports /test *(rw)
- Exporting the share:
Raw
# exportfs -r
- Restart the NFS service:
Raw
# systemctl restart nfs-server