Network File System (NFS) is a protocol for a distributed filesystem. That is, we can store files to a directory on a remote server and clients can mount the share. The remote directory will appear to the client as if it were local, although all data saved to it resides on the server. This recipe shows you how to configure NFS on a server and expose the storage as a network share. (The next recipe will show you how to configure NFS on a client.)
This recipe requires a CentOS system with a working network connection. You'll also need administrative privileges provided by logging in with the root
account.
Follow these steps to set up an NFS server:
Install the
nfs-utils
andlibnfsidmap
packages:yum install nfs-utils libnfsidmap
Create a globally accessible directory which will serve as the root of the file share:
mkdir -m 777 /var/nfsshare
Open /
etc/exports
and add the following entry to mark the directory for export...