ทาง Linuxgray อนุญาติให้ copy บทความได้ แต่กรุณาอ้างอิง ชื่อผู้เขียน และทำ Link มาที่ http://www.linuxgray.com ขอบคุณครับ
โดย
มนตรี สีเทา ( RHCT , RHCE )
( Last update 12/02/2011 )
http://www.linuxgray.com
ในบทความนี้เราจะมาสร้าง NFS Server ( Network File System ) สำหรับ share file และ directory ในองค์กร
1. ตั้งค่าการ share ในเครื่อง NFS Server
[root@nfs ~]# vi /etc/exports
เพิ่ม
/home 192.168.1.0/24(rw,sync,no_root_squash)
# อธิบาย
/home คือ directory ที่ share
192.168.1.0/24 คือ network ที่สามารถใช้งานได้
rw คือ permission อ่าน และ เขียนได้
sync คือ การ synchronize
no_root_squash คือ enable
root privilege
[root@nfs ~]#
/etc/rc.d/init.d/portmap start
Starting portmap:
[ OK ]
[root@nfs ~]#
/etc/rc.d/init.d/nfs start
Starting nfs services:
[ OK ]
Starting nfs quotas:
[ OK ]
Starting nfs daemon:
[ OK ]
Starting nfs mountd:
[ OK ]
[root@nfs ~]#
/etc/rc.d/init.d/nfslock start
Starting NFS statd:
[ OK ]
2. ตั้งค่าการ share ในเครื่อง NFS Client
[root@nfs ~]#
/etc/rc.d/init.d/portmap start
Starting portmap:
[ OK ]
[root@nfs ~]#
/etc/rc.d/init.d/nfslock start
Starting NFS statd:
[ OK ]
[root@nfs ~]#
/etc/rc.d/init.d/netfs start
Mounting other filesystems:
[ OK ]
[root@nfs ~]#
mount -t nfs nfs.linuxgray.com:/home /xxx
|