Container đóng vai trò NFS Server có IP là: 192.168.100.1 (container ID: 101) - OS: Centos 6.8 64bit
Container đóng vai trò NFS Client có IP là: 192.168.100.2 (container ID: 102) - OS: Centos 6.8 64bit
Thư mục cần chia sẻ NFS nằm trên NFS Server tên là: /data
Cài đặt NFS Server
Bước 1: Trên máy chủ Virtuozzo hardware node chạy lệnh sau để load module nfsd
Code:
# modprobe nfsd
Code:
# vzctl stop 101 # vzctl set 101 --features nfsd:on --save # vzctl start 101
Code:
# yum install rpcbind nfs-utils
Code:
# chkconfig rpcbind on # service rpcbind start
Code:
MOUNTD_NFS_V3="yes" RPCNFSDARGS="-N 4" NFSD_MODULE="noload"
Code:
# chkconfig nfs on # service nfs start
Code:
# mkdir /data # vi /etc/exports /home 192.168.100.2(rw,sync,no_root_squash,no_subtree_check) # export -a
Bước 1: Trên máy chủ Virtuozzo hardware node chạy lệnh sau để load module nfsd
Code:
# modprobe nfs
Code:
# vzctl stop 102 # vzctl set 102 --features nfs:on --save # vzctl start 102
Code:
# cat /proc/filesystems
Code:
# yum install nfs-utils nfs-utils-lib rpcbind
Code:
# chkconfig rpcbind on # /etc/init.d/rpcbind start # chkconfig nfs on # /etc/init.d/nfs start
Tạo thư mục /data trên máy NFS client
Code:
# mkdir /data
Code:
mount 192.168.100.1:/data /data
Code:
192.168.100.1:/data /data nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
Không có nhận xét nào:
Đăng nhận xét