On Ubuntu
Installing the NFS Server
- Log in to the storage node as an administrator and run the following command to install the NFS server:
apt install -y nfs-kernel-server
- Fix the NFS-related ports and configure a firewall for the ports as required.
- Run the following commands to create a shared directory (for example, /data/atlas_dls) and change the directory permission:
mkdir -p /data/atlas_dls chmod 750 /data/atlas_dls/
- Run the following command to add the content below to the end of the /etc/exports file to configure the allowed IP address as required and harden related permission settings:
/data/atlas_dls service_IP_address (with necessary permissions)
- Run the following commands to start rpcbind:
systemctl restart rpcbind.service systemctl enable rpcbind
- Run the following command to check whether rpcbind is started:
systemctl status rpcbind
If the following information is displayed, the service is running properly:
root@ubuntu:/data/kfa# service rpcbind status ● rpcbind.service - RPC bind portmap service Loaded: loaded (/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2021-01-08 16:39:03 CST; 6 days ago Docs: man:rpcbind(8) Main PID: 2952 (rpcbind) Tasks: 1 (limit: 29491) CGroup: /system.slice/rpcbind.service └─2952 /sbin/rpcbind -f -w Jan 08 16:39:03 ubuntu-211 systemd[1]: Starting RPC bind portmap service... Jan 08 16:39:03 ubuntu-211 systemd[1]: Started RPC bind portmap service. - After rpcbind is started, run the following commands to start the NFS service:
systemctl restart nfs-server.service systemctl enable nfs-server
- Run the following command to check whether the NFS service is started:
systemctl status nfs-server.service
If the following information is displayed, the service is running properly:
root@ubuntu:/data/kfa# service nfs-kernel-server status ● nfs-server.service - NFS server and services Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled) Active: active (exited) since Fri 2021-01-08 16:39:03 CST; 6 days ago Main PID: 3220 (code=exited, status=0/SUCCESS) Tasks: 0 (limit: 29491) CGroup: /system.slice/nfs-server.service Jan 08 16:39:03 ubuntu-211 systemd[1]: Starting NFS server and services... Jan 08 16:39:03 ubuntu-211 exportfs[3181]: exportfs: /etc/exports [1]: Neither 'subtree_check' or 'no_subtree_check' specified for export "*:/data/atlas_dls". Jan 08 16:39:03 ubuntu-211 exportfs[3181]: Assuming default behaviour ('no_subtree_check'). Jan 08 16:39:03 ubuntu-211 exportfs[3181]: NOTE: this default has changed since nfs-utils version 1.0.x Jan 08 16:39:03 ubuntu-211 systemd[1]: Started NFS server and services. - Run the following command to check the mounting permission of the shared directory (for example, /data/atlas_dls):
cat /var/lib/nfs/etab
If the following information is displayed, the service is running properly:
root@ubuntu:~# cat /var/lib/nfs/etab /data/atlas_dls * (rw, ... displays the configured permission.)
Installing the NFS Client
Log in to another server as an administrator and run the following command to install the NFS client:
apt install -y nfs-common
Parent topic: Installing NFS