You are on page 1of 3

NFS Server configuration

Run the below commands to begin the NFS Server installation:

[nfs-server ]# yum install nfs-utils rpcbind

Next we export some arbitrary directory called  /opt/nfs .


Create  /opt/nfs  directory:

[nfs-server ]# mkdir -p /opt/nfs

and edit  /etc/exports  NFS exports file to add the below line while replacing the IP
address  10.1.1.18  with the IP address of your client:

/opt/nfs 10.1.1.18(no_root_squash,rw,sync)

[root@web ~]# cat /etc/exports

#/data/ 192.168.100.0/24(rw,sync,no_root_squash,no_all_squash)

/data/ 192.168.100.106(rw,sync,no_root_squash,no_all_squash)

/data/ 192.168.100.107(rw,sync,no_root_squash,no_all_squash)

/data/ 192.168.100.103(rw,sync,no_root_squash,no_all_squash)

/data/ 192.168.100.104(rw,sync,no_root_squash,no_all_squash)

[root@web ~]#

Next make sure to enable  2049  port on your firewall to allow clients requests:

[nfs-server ]# firewall-cmd --zone=public --add-port=2049/tcp --permanent

[nfs-server ]# firewall-cmd --reload

Start  rpcbind  daemon and NFS server in this order:


[nfs-server ]# service rpcbind start; service nfs start

[root@web ~]# exportfs

/data 192.168.10.106

/data 192.168.10.107

Check the NFS server status:

[nfs-server ]# service nfs status

nfs-server.service - NFS Server

Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; disabled)

Active: active (exited) since Thu 2014-12-11 08:12:46 EST; 23s ago

Process: 2780 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS $RPCNFSDCOUNT


(code=exited, status=0/SUCCESS)

Process: 2775 ExecStartPre=/usr/sbin/exportfs -r (code=exited,


status=0/SUCCESS)

Process: 2773 ExecStartPre=/usr/libexec/nfs-utils/scripts/nfs-


server.preconfig (code=exited, status=0/SUCCESS)

Main PID: 2780 (code=exited, status=0/SUCCESS)

CGroup: /system.slice/nfs-server.service

[root@app1 data]# mount 192.168.10.210:/data /data/


Vi /etc/fstab

# /etc/fstab

# Created by anaconda on Thu Sep 22 11:29:05 2016

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

UUID=f7c5d69f-ceef-43d6-8c1d-b5d36e019f23 / xfs defaults 00

UUID=c9660c4d-6165-4002-bdcd-2965330640d1 /app xfs defaults 00

UUID=fb9c2470-c4f5-433d-bc1f-444ca50116c3 /backup xfs defaults 00

UUID=b5b29a13-06e5-48ec-94f0-e3ba61945c1b /boot xfs defaults 00

UUID=45217604-5ee8-411d-8d4d-c1507472cf31 swap swap defaults 00

192.168.100.105:/data /data nfs defaults 00

You might also like