Wednesday, June 5, 2013

Install and Configure NFS server

                                                                 
Three rpm are required to configure nfs server. nfs, portmap, xinetd check them if not found then install

[root@test ~]# rpm -qa nfs*
nfs-utils-lib-1.1.5-4.el6.x86_64
nfs-utils-1.2.3-26.el6.x86_64
nfs4-acl-tools-0.3.3-6.el6.x86_64
[root@test ~]# rpm -qa xinetd*
[root@test ~]# rpm -qa xinetd
[root@test ~]# rpm -qa portmap
[root@test ~]# yum install portmap
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: centos.aol.in                    
 * extras: centos.aol.in                  
 * updates: centos.aol.in                 
Setting up Install Process                
Resolving Dependencies                    
--> Running transaction check             
---> Package rpcbind.x86_64 0:0.2.0-9.el6 will be updated
---> Package rpcbind.x86_64 0:0.2.0-11.el6 will be an update
--> Finished Dependency Resolution                          

Dependencies Resolved

==============================================================================================================
 Package                  Arch                    Version                         Repository             Size 
==============================================================================================================
Updating:                                                                                                     
 rpcbind                  x86_64                  0.2.0-11.el6                    base                   51 k 

Transaction Summary
==============================================================================================================
Upgrade       1 Package(s)

Total download size: 51 k
Is this ok [y/N]: y
Downloading Packages:
http://centos.aol.in/6.4/os/x86_64/Packages/rpcbind-0.2.0-11.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403"
Trying other mirror.
rpcbind-0.2.0-11.el6.x86_64.rpm                                                        |  51 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : rpcbind-0.2.0-11.el6.x86_64                                                                1/2
  Cleanup    : rpcbind-0.2.0-9.el6.x86_64                                                                 2/2
  Verifying  : rpcbind-0.2.0-11.el6.x86_64                                                                1/2
  Verifying  : rpcbind-0.2.0-9.el6.x86_64                                                                 2/2

Updated:
  rpcbind.x86_64 0:0.2.0-11.el6

Complete!

[root@test ~]# yum install xinetd
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: centos.aol.in
 * extras: centos.aol.in
 * updates: centos.aol.in
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package xinetd.x86_64 2:2.3.14-38.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================
 Package                 Arch                    Version                          Repository             Size
==============================================================================================================
Installing:
 xinetd                  x86_64                  2:2.3.14-38.el6                  base                  121 k

Transaction Summary
==============================================================================================================
Install       1 Package(s)

Total download size: 121 k
Installed size: 259 k
Is this ok [y/N]:
requested URL returned error: 403"                                                                           
Trying other mirror.                                                                                          
rpcbind-0.2.0-11.el6.x86_64.rpm                                                        |  51 kB     00:00     
Running rpm_check_debug                                                                                       
Running Transaction Test                                                                                      
Transaction Test Succeeded                                                                                    
Running Transaction                                                                                           
  Updating   : rpcbind-0.2.0-11.el6.x86_64                                                                1/2 
  Cleanup    : rpcbind-0.2.0-9.el6.x86_64                                                                 2/2 
  Verifying  : rpcbind-0.2.0-11.el6.x86_64                                                                1/2 
  Verifying  : rpcbind-0.2.0-9.el6.x86_64                                                                 2/2 

Updated:
  rpcbind.x86_64 0:0.2.0-11.el6                                                                               

Complete!
[root@test ~]# yum install xinetd
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: centos.aol.in                    
 * extras: centos.aol.in                  
 * updates: centos.aol.in                 
Setting up Install Process                
Resolving Dependencies                    
--> Running transaction check             
---> Package xinetd.x86_64 2:2.3.14-38.el6 will be installed
--> Finished Dependency Resolution                          

Dependencies Resolved

==============================================================================================================
 Package                 Arch                    Version                          Repository             Size 
==============================================================================================================
Installing:                                                                                                   
 xinetd                  x86_64                  2:2.3.14-38.el6                  base                  121 k 

Transaction Summary
==============================================================================================================
Install       1 Package(s)

Total download size: 121 k
Installed size: 259 k
Is this ok [y/N]: y
Downloading Packages:
http://centos.aol.in/6.4/os/x86_64/Packages/xinetd-2.3.14-38.el6.x86_64.rpm: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 403"
Trying other mirror.
xinetd-2.3.14-38.el6.x86_64.rpm                                                        | 121 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 2:xinetd-2.3.14-38.el6.x86_64                                                              1/1
  Verifying  : 2:xinetd-2.3.14-38.el6.x86_64                                                              1/1

Installed:
  xinetd.x86_64 2:2.3.14-38.el6

Complete!

[root@test ~]# locate portmap                                       
/etc/selinux/targeted/modules/active/modules/portmap.pp                 
/usr/share/man/man8/portmap_selinux.8.gz                                
/usr/share/selinux/devel/include/services/portmap.if                    
/usr/share/selinux/targeted/portmap.pp.bz2                              
/usr/src/kernels/2.6.32-279.22.1.el6.x86_64/include/asm-generic/libata-portmap.h
/var/cache/rpcbind/portmap.xdr
[root@test ~]# /etc/init.d/portreserve start
Starting portreserve:
[root@test ~]# /etc/init.d/portreserve status
portreserve (pid  1590) is running...
[root@test ~]# /etc/init.d/xinetd start
Starting xinetd:                                           [  OK  ]
[root@test ~]# rpm -qa | grep bind
bind-utils-9.8.2-0.10.rc1.el6.x86_64
rpcbind-0.2.0-11.el6.x86_64
bind-libs-9.8.2-0.10.rc1.el6.x86_64
ypbind-1.20.4-29.el6.x86_64
samba-winbind-clients-3.5.10-125.el6.x86_64
[root@test ~]# service nfs restart
Shutting down NFS daemon:                                  [FAILED]
Shutting down NFS mountd:                                  [FAILED]
Shutting down NFS quotas:                                  [FAILED]
Starting NFS services:                                     [  OK  ]
Starting NFS quotas:                                       [  OK  ]
Starting NFS mountd:                                       [  OK  ]
Stopping RPC idmapd:                                       [  OK  ]
Starting RPC idmapd:                                       [  OK  ]
Starting NFS daemon:                                       [  OK  ]
[root@test ~]#
 restart nfs daemons with exportfs 

[root@test ~]# exportfs -r
[root@test ~]# chkconfig portreserve on
[root@test ~]# chkconfig nfs on
[root@test ~]# chkconfig xinetd on
[root@test ~]# mkdir /crush
[root@test ~]# chmod 777 /crush
[root@test ~]# vi /etc/exports
hare data folder for the network of 192.168.0.254/24 with read and write access
editing in exports
/crush 192.168.10.0/24(rw,rsync)

[root@test ~]# exportfs -r
[root@test ~]# showmount -e
Export list for test.example.net:
/crush 192.168.10.0/24

client side
 [root@test2 ~]# mount -t nfs 192.168.10.22:/crush /temp

[root@test2 ~]# cd /temp/
[root@test2 temp]# touch > test
touch: missing file operand
Try `touch --help' for more information.
[root@test2 temp]# cat > test
this is created for the nfs test
[root@test2 temp]#


to make the mount permanent. 

vi /etc/fstab

192.168.10.22  /temp nfs  default 0 0 

add this line and save it 


check the file created in client is available at server 

[root@test ~]# cd /crush/
[root@test crush]# ls
test
[root@test crush]# cat test
this is created for the nfs test



No comments: