Cấu hình NFS Server, NFS Client trong Container trên Parallels Cloud Server (PCS), Virtuozzo Container
I> Thực hiện trên Server Hardware Node
1. Load các module NFS Server và NFS Client trên Server Hardware Node
# modprobe nfs
# modprobe nfsd
2. Stop Container
#vzctl stop 2222
3. Enable tính năng nfs cho Containers bạn muốn cấu hình nfs
#vzctl set 2222 --features "nfs:on,nfsd:on" --save
4. Start lại Container
#vzctl start 2222
II> Thực hiện trong Container
1. Cài đặt NFS Server trên Centos 5 (Thí dụ ip server là: 10.0.0.1)
[root@dlp ~]#yum -y install nfs-utils
[root@dlp ~]#vi /etc/idmapd.conf
# line 5: uncomment and change to your domain name
Domain = parallels.com.vn
[root@dlp ~]# vi /etc/exports
/root/test 10.0.0.0/24(rw,sync,no_root_squash,no_all_squash)
# *note
/home ⇒ shared directory
10.0.0.0/24 ⇒ range of networks NFS permits accesses
rw⇒ writable
sync⇒ synchronize
no_root_squash⇒ enable root privilege
no_all_squash⇒ enable users' authority
[root@dlp ~]#/etc/rc.d/init.d/portmap start
Starting portmap: [ OK ]
[root@dlp ~]#/etc/rc.d/init.d/nfslock start
Starting NFS statd: [ OK ]
[root@dlp ~]#/etc/rc.d/init.d/nfs start
Starting NFS services:[ OK ]
Starting NFS quotas:[ OK ]
Starting NFS daemon:[ OK ]
Starting NFS mountd:[ OK ]
Starting RPC idmapd:[ OK ]
[root@dlp ~]#chkconfig portmap on
[root@dlp ~]#chkconfig nfslock on
[root@dlp ~]#chkconfig nfs on
2. Cài đặt và cấu hình NFS Client trên Container
[root@www ~]#
yum -y install nfs-utils
[root@www ~]#
vi /etc/idmapd.conf
# line 5: uncomment and change to your domain nameæ›´
Domain =parallels.com.vn
[root@www ~]#
/etc/rc.d/init.d/portmap start
Starting portmap:[ OK ]
[root@www ~]#
/etc/rc.d/init.d/nfslock start
Starting NFS statd: [ OK ]
[root@www ~]#
/etc/rc.d/init.d/netfs start
Mounting other filesystems:[ OK ]
[root@www ~]#
chkconfig portmap on
[root@www ~]#
chkconfig nfslock on
[root@www ~]#
chkconfig netfs on
Lệnh Mount
[root@www ~]#
mount -t nfs 10.0.0.1:/root/test /test
Chúc thành công!
