- This topic has 2개 답변, 2명 참여, and was last updated 11 years 전에 by
인베인. This post has been viewed 19 times
-
게시글
-
리눅스 커널은 nfs V2을 표준으로 지원을 하며, 커널 2.4+ 부터는
NFS V3를 모두 지원한다. 관련 S/W는 http://nfs.sourceforge.net/ 에서
다운 받아서 설치후 사용하면 됨.1. 리눅스에서 nfs 설정
#>mkdir /nfs
#>chown nobody.nobody /nfs
#>chmod 777 /nfs
#>vi /etc/exports
#/nfs localhost(rw,insecure)
#/nfs2 192.168.0.2(rw, sysnc, all_squash, anonuid=0, anongid=0)
#/nfs3 10.1.1.1(ro)
/nfs *(rw,no_root_squash,insecure)주의) 옵션 설정시 ,(콤마)사이에 공백을 두어 설정하게 되면
mount -t nfs 192.168.0.3:/nfs /tmp/nfs 명령시에는
아래와 같은 에러 메세지가 나온다.
.....nfs failed, reason given by server
(O) (rw,insecure) (X) (rw, insecure)#> service portmap start
Starting portmapper: [ OK ]
#> service nfs stop or #> /etc/init.d/nfs stop
#> service nfs start or #> /etc/init.d/nfs start
Starting nfs services: [ OK ]
Starting nfs quotas: [ OK ]
Starting nfs daemon: [ OK ]
Starting nfs mountd: [ OK ]-- [ #> rpcinfo -p ]------------------------------------------------------
프로그램 버전 원형 포트
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100003 2 udp 2049 nfs
100003 2 tcp 2049 nfs
100021 1 udp 32771 nlockmgr
100021 1 tcp 32819 nlockmgr
100011 1 udp 716 rquotad
100011 1 tcp 719 rquotad
100005 1 udp 724 mountd
100005 1 tcp 727 mountda. portmapper(111 port)가 닫혀있는 경우
---------------
Server --> Target : udp port sunrpc unreachable, length ** 관련 에러 메세지 발생함.
----------------
/etc/init.d/portmap restart으로 재시작해야하며, portmap이 open되지 않는 경우
/etc/iptables/selinux (SELINUX=disabled) 점검b. iptables(방화벽) 설정 해제
#> iptables -Fb. rpc.nfsd - nfs 서비스 데몬
c. rpc.mount - nfs 상에서의 파일시스템 마운트를 위한 서비스 데몬
d. portmap - RPC(원격 프로세스 호출)기반하에서 작동되는 nfs 서비스의 맵핑을 위해
사용되는 데몬
e. /etc/exports - nfs 마운트 디렉토리와 세부 옵션의 설정파일
-------------------------------------------------------------------------2. exportfs 명령으로 /etc/exports 파일 설정 문법 정상 여부 확인
- nfs 마운트를 하기전에 먼저 exportfs명령을 통하여
/etc/exports 파일의 설정이 제대로 작성되었는지 검사를 할수 있음.예) /usr/sbin/exportfs localhost:/nfs
(exports 파일이 정상이 아니면 에러메세지를 보여줄것이다.)3. nfs Client(Linux)에서 nfs Server(Linux)에 접근하기
#> mount -t nfs 192.168.0.3:/nfs /tmp/nfs
( #>mount servername: /sharedir/mountpoint /local-dir)#> umount /tmp/nfs
( #>umount /mounts/remote-home-dirs )참고) 가정에 있는 컴퓨터 연결 예제
#> mount -t nfs 222.122.13.138:/account/intomail/public_html/webmail /mnt/nfs4. nfs Server(Linux) - nfs Client(WindowXP) 서버에 접근
Humming Bird, OMNI nfs Enterprise(nfs Client) 프로그램을 윈도우에 설치후
Linux nfs서버의 IP주소 및 nfs디렉토리(/nfs)를 입력 및 Mount하여 접근.참고) insecure (인증제거)옵션 기능
exports옵션에 insecure추가: 인증방식에 상관없이 ID만 주만 접근가능.
exports옵션에 insecure없음: uid/gid로만 접근가능. (pcnfsd, nis는 접근불가)5. nfs Server(WindowsXP) - nfs Client(Linux) 서버에 접근
- nfs Server: Windows xp ( Omni Xlink nfs Server Version 4.2 )
- nfs Client: Redhat Linxu 9.0
- nfs Exported Directory : e:\nfs
- Exported Alias : /nfs
- Client Access : Deny All Client except, 192.168.23.1
- Directory Access: Read/Write
- Credential Mapping
1) Mapping - Account Name to UID Mapping - Windows Username선택
2) Specify UID Manually UID : 0을 기입 (리눅스 클라이언트에서 root접근허가)6. nfs서버에 접속시 유의사항
Rehdat 7/9은 nfs 2.0까지만 지원하기때문에 Omni nfs로 연결시
option에서 "[*] Disable nfs 3.0 을 체크" 해야만 접속을 할 수 있음.
nfs 서버에 접근시 서버에서 지원하는 nfs버젼이 1 , 2 , 3 중에
어느 것인지 잘 확인하여 아래의 옵션을 이용여 nfs버젼을 설정할것.옵션 예) -o nfsvers=n,uid=510,gid=510
nfsvers=n 원격 호스트의 nfs 데몬과 접속하기 위해
사용하는 별도의 RPC 버전 번호를 정한다. nfs
서버를 여러 개 운영하고 있을 때 사용한다.
기본값은 버전 2 이다.
port=n nfs 서버와 연결할 수 있는 포트 번호를
정한다. 만약 0 이라면( 기본값 ) 원격
호스트의 포트매퍼(portmapper) 에게 질의하여
알아내도록 한다. 만약 포트매퍼에 nfs 데몬이
등록되어 있지 않은 경우에는 2049 라는 표준
nfs 포트 번호가 사용된다.7. nfs Server Daemon가동시 캐시 디렉토리 정보
/var/lib/nfs/ Directory의 etab, rmtab, xtab 파일들의 캐쉬 정보가 제거되지 않은상태에서
다른 디렉토리를 nfs디렉토리로 마운팅하였을 경우 오동작을 일으킬수 있다.
이런 경우 /etc/init.d/nfs restart 해주거나, /var/lib/nfs/파일들을 vi편집기를 이용하여
Cache 정보를 제거하면 된다.* 오픈소스는 Open Innovationa & 윈윈전략을 도모할 지언정 절대 공짜(무료)임을 뜻하지 않는다.치
- 답변은 로그인 후 가능합니다.