이 블로그 검색

2017년 11월 19일 일요일

NFS 서버, 클라이언트 구성 - Ubuntu

NFS 서버(10.10.10.10), NFS 클라이언트(20.20.20.20)

서버(10.10.10.10)에서 NFS 관련 package 설치
root@ubuntu:~#apt-get install nfs-common nfs-kernel-server rpcbind

/data/nfs 디렉토리 생성 후 chmod 777 권한 변경
root@ubuntu:/data$ ls -al
total 28
drwxr-xr-x  4 root root  4096 Nov 19 21:41 .
drwxr-xr-x 24 root root  4096 Nov 19 18:02 ..
drwx------  2 root root 16384 Nov 19 18:02 lost+found
drwxrwxrwx  2 root root  4096 Nov 19 21:41 nfs


nfs 설정 파일에 공유할 폴더와 설정 추가
root@ubuntu:~#vi /etc/exports
# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#
/data/nfs       *(rw,sync,no_subtree_check)


root@ubuntu:~#service nfs-kernel-server restart
root@ubuntu:~#service rpcbind stop
root@ubuntu:~#service rpcbind start

클라이언트(20.20.20.20)에서 nfs-common 패키지 설
root@ubuntu:~#apt-get install nfs-common

서버에서 export 된 디렉토리 /root/v7000 에 mount
root@ubuntu:~# mount -t nfs -o nolock 10.10.10.10:/data/nfs /root/v7000
root@ubuntu:~/v7000# df -h
Filesystem               Size  Used Avail Use% Mounted on
udev                     475M     0  475M   0% /dev
tmpfs                     99M  4.8M   95M   5% /run
/dev/sda1                 19G   11G  7.4G  59% /
tmpfs                    495M  4.0K  495M   1% /dev/shm
tmpfs                    5.0M     0  5.0M   0% /run/lock
tmpfs                    495M     0  495M   0% /sys/fs/cgroup
tmpfs                     99M     0   99M   0% /run/user/0
10.10.10.10:/data/nfs   50G   52M   47G   1% /root/v7000

댓글 없음:

댓글 쓰기