1 / 21

NFS 를 이용한 파일공유

NFS 를 이용한 파일공유. SPARCS 12 naldo. NFS. Network File System 의 약자 다른 서버에서 공유한 디렉토리를 마운트하여 자신의 디렉토리처럼 사용하는 것 RPC(Remote Procedure Call) 기반 시스템 한 프로그램이 네트워크 상의 다른 컴퓨터에 위치하고 있는 프로그램에 서비스를 요청하는데 사용되는 프로토콜. NFS. 1980년대 Sun Microsystems에서 처음으로 개발됨 유닉스에서 파일을 공유하기 위해 만들어짐

warner
Download Presentation

NFS 를 이용한 파일공유

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NFS를 이용한 파일공유 SPARCS 12 naldo

  2. NFS • Network File System의 약자 • 다른 서버에서 공유한 디렉토리를마운트하여 자신의 디렉토리처럼 사용하는 것 • RPC(Remote Procedure Call) 기반 시스템 • 한 프로그램이 네트워크 상의 다른 컴퓨터에 위치하고 있는 프로그램에 서비스를 요청하는데 사용되는 프로토콜

  3. NFS • 1980년대 Sun Microsystems에서처음으로개발됨 • 유닉스에서 파일을 공유하기 위해 만들어짐 • Windows Services for UNIX – Windows용

  4. PORTMAPPER • RPC(Remote Procedure Call) 사용시 포트가 동적으로 할당됨 • Portmapper를 이용하여 할당된 포트를 클라이언트에게 알림 • 데몬 상태로 대기 하다가 요청 시 Bind 역할을 함

  5. NFS 서버

  6. NFS 서버 구축 • NFS 서버와 Client 서버양 쪽 다설정이필요함 • NFS 서버에서는 공유할 디렉토리와 그 디렉토리를마운트 가능한 서버를 지정 • Clinet 서버는 사용할 폴더를 마운트 하는 작업이 필요함

  7. NFS 설치 (Packages) • # apt-get install nfs-common nfs-kernel-server portmap • nfs-common pakcage • nfs-kernel-server package • portmap package

  8. NFS 서버 디렉토리 설정 • 디렉토리 설정 • $chmod –R 777 [directory name] • 환경 설정 파일 수정 • # vim /etc/exports

  9. NFS 서버 /etc/exports 설정 • /etc/exports : 줄 단위로 설정 및 처리 [share-directory][client](options) • [share-directory] : 공유할 디렉토리의 절대경로 • [client] : 공유를 허락할 호스트 목록 • (Host name, Domain name, IP Address) • (option) : 공유할 때의 속성들

  10. NFS 서버 /etc/exports 설정 • (option) • ro – 읽기(default) • rw – 읽기 및 쓰기 • no_root_squash – client의 root 사용자가 NFS Server접근 시 root권한 • root_squash – client root접근시nfsnobody권한(default) • ercure – client요청시 지정 포트만 사용(default) • insecure – client요청시 모든 포트를 통해 서비스 요청 허가 • sync – client가 파일 시스템을 변경하면 즉시 동기화

  11. NFS 서버 재시작 • # /etc/init.d/nfs-kernel-server restart • # /etc/init.d/portmap restart

  12. NFS 서버 RPC 확인 • $ rpcinfo –p • NFS동작 시RPC 정보를 보여줌 • NFS 서비스에 필요한 데몬 동작 여부 확인 • nfs : NFS 서비스 데몬 • portmap : RPC 연결에관한 데몬 • nlockmgr : 파일 잠금 제공및 파일 동시 수정 방지

  13. NFS 서버 테스트 • NFS 서버 자기 자신으로의 마운트를 통한 테스트 • # mount  -t  nfs hostname(or IP):[share directory][mount directory] • 경고 발생 하지 않을 시성공

  14. Client 서버

  15. Client 서버 테스트 • Client 서버에서도 테스트를 함 • # mount  -t  nfs hostname(or IP):[share directory][mount directory] 143.248.234.111

  16. Client 서버 마운트 설정 • /etc/fstab파일 수정 • Hostname(or IP):[share directory] [mount directory] nfs [option] [dump] [system_checking] • # mount -a • Ex) 192.168.0.2:/data    /nfsnfsbg,soft,rw  0 0 위의 내용은 192.168.0.2의 data디렉토리를/nfs디렉토리로마운트 하되 파일시스템은 nfs이며 백그라운드로, 소프트타입으로, 읽기쓰기가 가능 하도록 하며 부팅 시 파일 시스템 점검은 하지 않도록 설정한 것이다.

  17. Client 서버 마운트 설정

  18. Client 서버에서 NFS 찾기 • NFS 서버의 실행여부와 디렉토리 명을 알 필요 있다. • # showmount [server] : NFS로 접속해 있는 서버들을 알 수 있다. • # showmount–e [server] : NFS로 공유할 수 있는 디렉토리 목록을 보여준다. • 서버가 죽어 있으면 RPC가 동작하지 않아서 에러발생

  19. Client 서버에서 언마운트하기 # umount[디렉토리] • 단순히 이 명령어로 NFS 서버의 share directory를 언마운트 가능

  20. 실습하기 • 주어진 NFS 공유 디렉토리를마운트 해보세요. • showmount명령어를 사용하여 NFS가 제대로 연결 되었나 확인해 보세요. • 언마운트를 통해 NFS 연결을 끊어보세요

  21. 감사합니다!!

More Related