NFS Server - Red Hat 7 / 8
A Network File System (NFS) allows remote hosts to mount file systems over a network and interact with those file systems as though they are mounted locally. This enables system administrators to consolidate resources onto centralized servers on the network.
Server Konfiguration
Installation eines NFS Servers, um eigene Dateien via Netzwerkshare zu verwalten.
Benötigte Packete Installieren
# yum -y install nfs-utils
Festlegen des korrekten Domain-namens:
# vim /etc/idmapd.conf
[General] #Verbosity = 0 # The following should be set to the local NFSv4 domain name # The default is the host's DNS domain name. Domain = blackgate.org ..
Definition eines neuen NFS Shares:
# vim /etc/exports
/volume1/server-backups 192.168.1.0/24(rw,sync)
In this example all Clients in 192.168.1.0/24 can mount /volume1/server-backups read/write and all transfers to disk are committed to the disk before the write request by the client is completed.
Setzen der korrekten Firewall Rules:
# firewall-cmd --add-service=nfs --permanent # firewall-cmd --add-service=rpcbind --permanent # firewall-cmd --add-service=mountd --permanent # firewall-cmd --reload
Zum Schluss wird der Services gestartet und enabled:
# systemctl enable rpcbind nfs-server --now
Client Konfiguration
Benötigte Packete Installieren
# yum -y install nfs-utils
Benötigte Services starten und enablen:
# systemctl enable rpcbind --now
Mounten des Shares: server-backups auf das Verzeichnis: /mnt/server-backup
# mount -t nfs -o rw,hard 192.168.1.21:/volume1/server-backups /mnt/server-backup
Für einen Eintrag in die /etc/fstab lautet die Syntax wie folgt:
10.0.0.21:/volume1/media /mnt/blackserv nfs rw,hard,intr 0 0