Guys,
I referred the following steps :
NFS server configure for NFSv4 :
How NFS Works?
NFS consists of at least two main parts: a server and one or more clients. The client remotely accesses the data that is stored on the server machine. In order for this to function properly a few processes have to be configured and running.
The server has to be running the following daemons:
Daemon Description :
nfsd The NFS daemon which services requests from the NFS clients.
mountd The NFS mount daemon which carries out the requests that nfsd(8) passes on to it.
rpcbind This daemon allows NFS clients to discover which port the NFS server is using.
The client can also run a daemon, known as nfsiod. The nfsiod daemon services the requests from the NFS server. This is optional, and improves performance, but is not required for normal and correct operation. See the nfsiod(8)[man 8 nfs] manual page for more information.
Note : I have done it on NFS server RHEL5.x64 and NFS client RHEL6.x64.
NFS server configuration for nfs4 :
[root@vm12 alltestfiles]#yum install nfs-utils nfs4-acl-tools portmap
[root@vm12 alltestfiles]# cat /etc/exports
/var/nfs4testing/ 10.65.211.15(rw,sync,fsid=0) //Share File System /var/nfs4testing
[root@vm12 alltestfiles]#
ps : fsid is very important here.
[root@vm12 alltestfiles]# chkconfig nfs on
[root@vm12 alltestfiles]# chkconfig portmap on
[root@vm12 alltestfiles]# chkconfig --list | grep nfs
nfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nfslock 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@vm12 alltestfiles]# chkconfig --list | grep portmap
portmap 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@vm12 alltestfiles]#
[root@vm12 alltestfiles]# vi /etc/sysconfig/iptables
[root@vm12 alltestfiles]# cat /etc/sysconfig/iptables | grep 10.65.211
-A RH-Firewall-1-INPUT -s 10.65.211.0/24 -m state --state NEW -p tcp --dport 2049 -j ACCEP
[root@vm12 alltestfiles]#
[root@vm12 alltestfiles]# vi /etc/hosts.deny
[root@vm12 alltestfiles]# vi /etc/hosts.allow
[root@vm12 alltestfiles]# cat /etc/hosts.deny | grep portmap
# The portmap line is redundant, but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!
portmap:ALL
[root@vm12 alltestfiles]# cat /etc/hosts.allow| grep 10.65.211
portmap:10.65.211.0/24
portmap:10.65.192.0/24
[root@vm12 alltestfiles]#
Verify :
[root@vm12 alltestfiles]# rpcinfo -p
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 896 status
100024 1 tcp 899 status
100011 1 udp 1000 rquotad
100011 2 udp 1000 rquotad
100011 1 tcp 1003 rquotad
100011 2 tcp 1003 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 60156 nlockmgr
100021 3 udp 60156 nlockmgr
100021 4 udp 60156 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 51539 nlockmgr
100021 3 tcp 51539 nlockmgr
100021 4 tcp 51539 nlockmgr
100005 1 udp 603 mountd
100005 1 tcp 606 mountd
100005 2 udp 603 mountd
100005 2 tcp 606 mountd
100005 3 udp 603 mountd
100005 3 tcp 606 mountd
[root@vm12 alltestfiles]#
or nfsstat
NFS client configure for NFSv4 : -
yum install nfs-utils
[root@kmaiti ~]# hostname -i
10.65.192.160 127.0.0.1
[root@kmaiti ~]#
[root@kmaiti ~]# cat /etc/sysconfig/iptables | grep 2049
#-A RH-Firewall-1-INPUT -s 10.65.192.0/24 -m state --state NEW -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
[root@kmaiti ~]# mount -t nfs 10.65.211.12:/ /mounted/
[root@kmaiti ~]# df -HT | column -t
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/HelpDeskRHEL6-Root
ext4 16G 5.3G 9.5G 36% /
tmpfs tmpfs 2.0G 455k 2.0G 1% /dev/shm
/dev/mapper/HelpDeskRHEL6-NotBackedUp
ext4 8.5G 154M 7.9G 2% /NotBackedUp
/dev/mapper/HelpDeskRHEL6-VirtualMachines
ext4 21G 181M 20G 1% /VirtualMachines
/dev/sda1 ext4 204M 47M 147M 25% /boot
/dev/mapper/HelpDeskRHEL6-Home
ext4 4.3G 263M 3.8G 7% /home
10.65.211.12:/
nfs4 8.3G 1.6G 6.3G 20% /mounted
[root@kmaiti ~]#
[root@kmaiti ~]# cat /etc/fstab | grep mounted
10.65.211.12:/ /mounted nfs4 soft,intr,rsize=8192,wsize=8192,nosuid 0 0
[root@kmaiti ~]#
try :
)
Tuesday, 21 December 2010
How to install and configure NFSv4 server and client on linux machine?
Posted on 04:03 by Unknown
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment