yum install nfs-utilsThe following services are found in the nfs-utils package and will be used throughout the installation guide
Service | Description |
---|---|
nfs-server | Enabled the clients to access NFS server |
rpcbind | Converts RPC program numbers into universal addresses |
nfs-lock / rpc-statd | NFS file locking. Implemented file lock recovery when an NFS server crashes and reboots |
nfs-idmap | Translates user and group ids into names, and vice-versa |
systemctl enable rpcbind systemctl enable nfs-server
systemctl start rpcbind systemctl start nfs-server systemctl start rpc-statd systemctl start nfs-idmapd
mkdir -p /nfs/export1Now we need to edit /etc/exports to allow for other devices to mount. You will need to replace x.x.x.x with the ip address of the server you wish to allow to connect
vim /etc/exports
/nfs/export1 x.x.x.x(rw,sync,no_root_squash)
Once you have edited the /etc/exports file you will need to push these changes through:
exportfs -r
firewall-cmd --permanent --zone public --add-service mountd firewall-cmd --permanent --zone public --add-service rpc-bind firewall-cmd --permanent --zone public --add-service nfs firewall-cmd --reload