天天看點

How to configure NFS in RHEL 7?

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

<code># yum install nfs-utils rpcbind</code>

Enable the services at boot time:

<code># systemctl enable nfs-server # systemctl enable rpcbind # systemctl enable nfs-lock &lt;-- 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 &lt;-- 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.</code>

Start the NFS services:

<code># systemctl start rpcbind # systemctl start nfs-server # systemctl start nfs-lock # systemctl start nfs-idmap</code>

Check the status of NFS service:

<code># systemctl status nfs</code>

Create a shared directory:

<code># mkdir /test</code>

Export the directory:

<code># vi /etc/exports /test *(rw)</code>

Exporting the share:

<code># exportfs -r</code>

Restart the NFS service:

<code># systemctl restart nfs-server</code>

繼續閱讀