NFS allows a linux server to share directories with other UNIX clients over network. NFS server exports a directory and NFS client mounts this directory. RHEL 7 supports two version of NFS – NFSv3 and NFSv4.
Job for nfs-server.service failed because the control process exited with error code. See 'systemctl status nfs-server.service' and 'journalctl -xe' for details.
- Unit Description=NFS server and services DefaultDependencies=no Requires=network.target proc-fs-nfsd.mount Requires=nfs-mountd.service Wants=rpcbind.socket Wants=nfs-idmapd.service After=local-fs.target After=network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service After=nfs-idmapd.service rpc-statd.service Before=rpc-statd-notify.service # GSS services dependencies.
- 先简单介绍一下nfs服务器是什么?nfs server可以看作是一个file server,它可以让你的pc通过网络将远端的nfs server共享出来的档案mount到自己的系统中,在client看来使用nfs的远端文件就象是在使用本地文件一样。.
- Jul 20 08:52:09 Ubuntu-mate systemd1: Job nfs-server.service/start failed with result 'dependency'. Jul 20 08:52:09 Ubuntu-mate systemd1: Unit proc-fs-nfsd.mount entered failed state. Jul 20 08:52:09 Ubuntu-mate systemd1: nfs-idmapd.service: control process exited, code=exited status=1 Jul 20 08:52:09 Ubuntu-mate systemd1: Unit nfs.
NFS server and RPC processes
starting the nfs-server process starts the NFS server and other RPC processes. RPC processes includes:
– rpc.statd : implements monitoring protocol (NSM) between NFS client and NFS server
– rpc.mountd : NFS mount daemon that implements the server side of the mount requests from NFSv3 clients.
– rpc.idmapd : Maps NFSv4 names and local UIDs and GIDs
– rpc.rquotad : provides user quota information for remote users.
– rpc.statd : implements monitoring protocol (NSM) between NFS client and NFS server
– rpc.mountd : NFS mount daemon that implements the server side of the mount requests from NFSv3 clients.
– rpc.idmapd : Maps NFSv4 names and local UIDs and GIDs
– rpc.rquotad : provides user quota information for remote users.
Configuring NFS server
1. Install the required nfs packages if not already installed on the server :
2. Enable the services at boot time:
In RHEL7.1 (nfs-utils-1.3.0-8.el7) enabling nfs-lock does not work (No such file or directory). it does not need to be enabled since rpc-statd.service is static.
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.
3. Start the NFS services:
4. Check the status of NFS service:
5. Create a shared directory:
6. Export the directory. The format of the /etc/exports file is :
Client options include (defaults are listed first) :
ro / rw :
a) ro : allow clients read only access to the share.
b) rw : allow clients read write access to the share.
sync / async :
a) sync : NFS server replies to request only after changes made by previous request are written to disk.
b) async : specifies that the server does not have to wait.
wdelay / no_wdelay
a) wdelay : NFS server delays committing write requests when it suspects another write request is imminent.
b) no_wdelay : use this option to disable to the delay. no_wdelay option can only be enabled if default sync option is enabled.
no_all_squash / all_squash :
a) no_all_squash : does not change the mapping of remote users.
b) all_squash : to squash all remote users including root.
root_squash / no_root_squash :
a) root_squash : prevent root users connected remotely from having root access. Effectively squashing remote root privileges.
b) no_root_squash : disable root squashing.
ro / rw :
a) ro : allow clients read only access to the share.
b) rw : allow clients read write access to the share.
sync / async :
a) sync : NFS server replies to request only after changes made by previous request are written to disk.
b) async : specifies that the server does not have to wait.
wdelay / no_wdelay
a) wdelay : NFS server delays committing write requests when it suspects another write request is imminent.
b) no_wdelay : use this option to disable to the delay. no_wdelay option can only be enabled if default sync option is enabled.
no_all_squash / all_squash :
a) no_all_squash : does not change the mapping of remote users.
b) all_squash : to squash all remote users including root.
root_squash / no_root_squash :
a) root_squash : prevent root users connected remotely from having root access. Effectively squashing remote root privileges.
b) no_root_squash : disable root squashing.
Example :
7. Exporting the share :
-r re-exports entries in /etc/exports and sync /var/lib/nfs/etab with /etc/exports. The /var/lib/nfs/etab is the master export table. Other options that can be used with exportfs command are :
8. Restart the NFS service:
Configuring NFS client
1. Install the required nfs packages if not already installed on the server :
2. Use the mount command to mount exported file systems. Syntax for the command:
Eample :
This example does the following:
– It mounts /home from remote host (remote_host) on local mount point /remote_home.
– File system is mounted read-only and users are prevented from running a setuid program (-o ro,nosuid options).
– It mounts /home from remote host (remote_host) on local mount point /remote_home.
– File system is mounted read-only and users are prevented from running a setuid program (-o ro,nosuid options).
3. Update /etc/fstab to mount NFS shares at boot time.
Job For Nfs Server Service Canceled Centos 8
Firewalld services to be active on NFS server
Linux Job For Nfs-server.service Canceled
For the NFS server to work, enable the nfs, mountd, and rpc-bind services in the relevant zone in the firewall-config application or using firewall-cmd :