Managing NFS Server
-----------------------------------
Machine1=server
Machine2=client
system-config-nfs(GUI)
NFS server configuration
-------------------------
1. Run the following services:
# su root
# server>setup
select SYSTEM SERVICE
from list
[*] portmap
[*] xinetd
[*] nfs
$ rpm -qa |grep nfs
# service portmap|xinetd|nfs restart
2. create directory and give full permission:
# mkdir /data
# chmod 777 /data
3. Add it in /etc/exports file:
# vi /etc/exports
/data *(rw,sync) --* is for all machines/IP
Note: Here * means access to all IPs while we can restrict by providing IP address like:
[/data IP(rw,sync)]
4. Mount it:
# /usr/sbin/exportfs -av --To restart exportfs -r
verify with showmount command that you have successfully shared data folder:
# showmount -e
5. Restart NFS:
service nfs restart
service nfslock start
chkconfig portmap|nfs on
or
chkconfig --level 35 nfs on
chkconfig --level 35 nfslock on
chkconfig --level 35 portmap on
NFS client configuration
-------------------------
# showmount -e serverIP
now mount this share folder on mnt mount point. To test this share folder change directory to mnt and create a test file:
# mount -t nfs serverIP:/data /mnt [-o nolock] --mount serverIP:/data /data
[-o nolock] is optional for ERP Apps, its equivalent is in fstab: :/mnt/inst /mnt/dir nfs auto,nolock 0 0
# cd /mnt
# cat > test
After use you should always unmount from mnt mount point:
# cd
# umount /mnt
In this way you can use shared folder. But this share folder will be available till system is up. It will not be available after reboot. To keep it available after reboot make its entry in fstab
create a mount point, by making a directory:
# mkdir /temp --mkdir /data
now open /etc/fstab file:
# vi /etc/fstab
make entry for nfs shared directory and define /temp to mount point:
serverIP:/data /temp nfs defaults 0 0
--serverIP:/data /data nfs defaults 0 0
--serverIP:/data /mnt/nfs nfs defaults 0 0
save the with :wq and exit reboot the system with reboot -f command
# reboot -f
after reboot check /temp directory it should show all the shared data:
# cd /temp
# ls
References:
http://computernetworkingnotes.com/network-administrations/nfs-server.html
http://oracle-base.com/articles/linux/linux-nfs-configuration.php
-----------------------------------
Machine1=server
Machine2=client
system-config-nfs(GUI)
NFS server configuration
-------------------------
1. Run the following services:
# su root
# server>setup
select SYSTEM SERVICE
from list
[*] portmap
[*] xinetd
[*] nfs
$ rpm -qa |grep nfs
# service portmap|xinetd|nfs restart
2. create directory and give full permission:
# mkdir /data
# chmod 777 /data
3. Add it in /etc/exports file:
# vi /etc/exports
/data *(rw,sync) --* is for all machines/IP
Note: Here * means access to all IPs while we can restrict by providing IP address like:
[/data IP(rw,sync)]
4. Mount it:
# /usr/sbin/exportfs -av --To restart exportfs -r
verify with showmount command that you have successfully shared data folder:
# showmount -e
5. Restart NFS:
service nfs restart
service nfslock start
chkconfig portmap|nfs on
or
chkconfig --level 35 nfs on
chkconfig --level 35 nfslock on
chkconfig --level 35 portmap on
NFS client configuration
-------------------------
# showmount -e serverIP
now mount this share folder on mnt mount point. To test this share folder change directory to mnt and create a test file:
# mount -t nfs serverIP:/data /mnt [-o nolock] --mount serverIP:/data /data
[-o nolock] is optional for ERP Apps, its equivalent is in fstab: :/mnt/inst /mnt/dir nfs auto,nolock 0 0
# cd /mnt
# cat > test
After use you should always unmount from mnt mount point:
# cd
# umount /mnt
In this way you can use shared folder. But this share folder will be available till system is up. It will not be available after reboot. To keep it available after reboot make its entry in fstab
create a mount point, by making a directory:
# mkdir /temp --mkdir /data
now open /etc/fstab file:
# vi /etc/fstab
make entry for nfs shared directory and define /temp to mount point:
serverIP:/data /temp nfs defaults 0 0
--serverIP:/data /data nfs defaults 0 0
--serverIP:/data /mnt/nfs nfs defaults 0 0
save the with :wq and exit reboot the system with reboot -f command
# reboot -f
after reboot check /temp directory it should show all the shared data:
# cd /temp
# ls
References:
http://computernetworkingnotes.com/network-administrations/nfs-server.html
http://oracle-base.com/articles/linux/linux-nfs-configuration.php
No comments:
Post a Comment