Tuesday, May 31, 2011

How To Setup NFS on CentOS

How to setup NFS on CentOS:

1. Server Side :

- kena install nfs,nfs utils,portmap :

# yum install nfs-utils nfs4-acl-tools portmap

- kena allow file ape yg nak share dan ip mane allowed kt /etc/export :

/backup/srv77 192.168.0.3(rw,sync,no_root_squash,fsid=0)

- kena allow portmap kt /etc/hosts.allow :

portmap: 192.168.0.0/255.255.255.0, 10.0.0.0/255.0.0.0
portmap: 192.168.0.4/255.255.255.0

- kena allow ip kt firewall,iptables or csf :

192.168.0.3

- kena set service nfs dan portmap kt initial setup :

chkconfig --level 235 nfs on
chkconfig --level 235 portmap on

- kena start service nfs dan portmap :

/etc/init.d/nfs start
/etc/init.d/portmap start

2. Client side :

- kena install nfs,nfs utils,portmap :

# yum install nfs-utils nfs4-acl-tools portmap

- kena create folder utk mount :

mkdir /mnt/srv4

- kena add kt /etc/fstab :

192.168.0.4:/backup/srv77 /mnt/srv4 nfs rw,hard,intr 0 0

- kena allow ip kt firewall,iptables or csf :

192.168.0.4

- kena set service nfs dan portmap kt initial setup :

chkconfig --level 235 nfs on
chkconfig --level 235 portmap on

- kena start service nfs dan portmap :

/etc/init.d/nfs start
/etc/init.d/portmap start

- kena add usef nfs :

useradd nfs -u 1000

- kena mount nfs to /mnt/srv4 :

mount -t nfs 192.168.0.4:/backup/srv77 /mnt/srv4 atau

mount -t nfs -o rw 192.168.0.4:/backup/srv77 /mnt/srv4

- nak remount nfs

mount -o remount,defaults,ro /mnt/Qbackup

or

mount -o remount,defaults,rw /mnt/Qbackup

instead of

mount -o remount,rw /mnt/Qbackup


COMMAND LAIN :

mount | grep -i '192.168.0.4'

nfsstat


No comments:

Post a Comment