[AIX 네트워크 관리 34] NFS (3) 복제와 전역 이름 공간(referral·replica), 위임, STNFS

핵심 정리

  • referral: 내보내기 항목에 -vers=4,refer=/경로@서버를 적으면 클라이언트가 다른 서버의 데이터로 투명하게 이동합니다. v4 전용이며 위치는 8개까지, 그 자리에 파일·디렉터리가 있으면 실패하고 순환 referral을 만들지 않게 해야 합니다.
  • replica: -vers=4,replicas=/data@account1:/backup/data@inreserve처럼 사본 위치를 8개까지 적습니다. 서버는 먼저 chnfs -R on으로 휘발성 파일 핸들을 쓰도록 해야 하고(v4 내보내기가 없을 때만 바꿀 수 있음), 복제 내보내기는 파일 시스템 전체여야 하며 모든 사본의 접근 제어가 같아야 합니다. 보통 읽기 전용이고 데이터 일관성은 관리자 몫입니다.
  • 장애 조치는 기본으로 timeo의 두 배 동안 RPC가 성공하지 않으면 시작하며 retrans × timeo에 영향을 받습니다. nfso -o nfs_v4_fail_over_timeout으로 전역 값을, nfs4cl prefer로 선호 사본을 정합니다. soft 마운트는 ETIMEDOUT을 낼 수 있어 권하지 않습니다. 복제·referral 서버는 64비트 커널이어야 합니다.
  • scatter=full|partial|none으로 클라이언트마다 위치 목록 순서를 달리해 부하를 나눕니다.
  • 위임: AIX 서버는 읽기 위임만(64비트 커널) 주고 클라이언트는 읽기·쓰기 위임을 지원합니다. 콜백 경로가 필요하며 /etc/nfs/nfs4_callback.conf로 주소를 정합니다. nfso -o server_delegation=0, client_delegation=0, 내보내기의 deleg=yes|no. STNFS(6.1)는 mount -v stnfs로 서버 이미지를 로컬에서만 바꿔 쓰는 단기 파일 시스템입니다.
항목 내용
버전 AIX 5.3(5300-03 이후), AIX 6.1 (STNFS는 6.1판에만 있음)
원문 Networks and communication management — 5.3판 399407쪽, 6.1판 505514쪽
파일 /etc/exports, /etc/nfs/nfs4_callback.conf, /etc/nfs/hostkey
관련 명령어 exportfs, mount, chnfs -R, nfs4cl, nfso, nfshostkey, kadmin.local

NFS 버전 4(NFSv4) 프로토콜은 시스템 관리자가 데이터 사용자에게 투명한 방식으로 여러 서버에 데이터를 나눠 둘 수 있는 기능을 제공합니다.

AIX 5L Version 5.3 with the 5300-03 Recommended Maintenance package부터 제공되는 두 기능을 쓸 수 있습니다. 첫째는 referral이라는 전역 이름 공간 기능입니다. 둘째는 데이터 사본을 찾을 수 있는 위치를 지정하는 방법으로, replica라고 합니다.

referral은 서버의 이름 공간에 만들 수 있는 특수 객체로, 위치 정보가 붙어 있습니다. 서버는 NFSv4 프로토콜 기능으로 클라이언트를 위치 정보에 지정한 서버로 보냅니다. referral은 여러 NFS 서버의 데이터를, referral을 아는 NFSv4 클라이언트가 탐색할 수 있는 단일 파일 이름 공간 트리로 통합하는 기본 요소가 됩니다.

replica는 한 NFS 서버의 파일 시스템 사본을 다른 여러 NFS 서버(또는 같은 서버의 다른 디스크 같은 다른 위치)에 둔 것입니다. replica를 아는 NFSv4 클라이언트가 쓰고 있는 replica 위치를 쓸 수 없게 되면 클라이언트는 쓸 수 있는 다른 replica로 바꿉니다. replica에 관한 자세한 정보는 NFS replica를 봅니다.

영어 원문

NFS replication and global namespace

The NFS version 4 (NFSv4) protocol provides functions that allows you, as the system administrator, to distribute data across multiple servers in a way that is transparent to the users of that data.

You can use two features provided beginning with AIX 5L Version 5.3 with the 5300-03 Recommended Maintenance package. The first is a global namespace feature called a referral. The second feature is a means of specifying locations where copies of data can be found, which is called a replica.

A referral is a special object you can create in the namespace of a server to which location information is attached. The server uses NFSv4 protocol features to redirect clients to the server specified in the location information. The referral forms a building block for integrating data on multiple NFS servers into a single file namespace tree that referral-aware NFSv4 clients can navigate.

A replica is a copy of a file system on one NFS server that has been placed on several other NFS servers (or at an alternate location, such as a different disk on the same server). If a given replica location in use by a replica-aware NFSv4 client becomes unavailable, then the client will switch to another available replica. For more information about replicas, refer to NFS replicas.

NFS referral

다음 예는 referral을 이해하는 데 도움이 되는 시나리오입니다.

다음 예에는 서버가 넷 있습니다.

  • publications 서버에는 문서 파일이 있습니다.
  • projects 서버에는 사용자 작업 디렉터리가 있습니다.
  • data 서버에는 정보 데이터베이스가 있습니다.
  • account1 서버는 다른 모든 파일을 내보내는 주 NFS 서버이며 모든 클라이언트가 아는 서버입니다.

모든 클라이언트가 주 NFS 서버의 파일에 접근하게 하기

account1 서버는 /etc/exports 파일의 다음 문으로 /work 디렉터리를 모든 클라이언트에 내보냅니다.

text
/work -vers=4

모든 클라이언트는 다음 명령으로 account1 서버의 / 를 /mnt 디렉터리에 마운트해 원격 디렉터리 /work의 파일에 접근할 수 있습니다.

text
mount -o vers=4 account1:/ /mnt

클라이언트의 사용자가 /mnt 디렉터리 내용을 나열하면 /mnt/work 경로에 원격 디렉터리 work가 보입니다. 클라이언트의 /mnt/work 디렉터리 내용은 account1 서버의 /work 디렉터리 내용과 같습니다.

클라이언트가 특정 서버의 파일에 접근하게 하기

클라이언트 사용자는 publications 서버의 /usr/doc 디렉터리에도 접근하려 합니다.

이전 릴리스에서는 서버에서 디렉터리를 내보내고 클라이언트에서 디렉터리를 마운트해야 했습니다.

referral로 분산 이름 공간 만들기

클라이언트가 데이터 위치를 모른 채 다른 서버의 데이터에 접근하도록 서버를 설정할 수 있습니다. 데이터 위치는 referral을 거는 서버의 관리자만 알면 됩니다. referral을 거는 서버는 referral로 클라이언트를 /usr/doc 디렉터리 위치로 보낼 수 있습니다. publications 서버에서는 내보내기 파일에 다음 문을 더해 /usr/doc 디렉터리를 내보낼 수 있습니다.

text
/usr/doc -vers=4

이렇게 하면 NFSv4 클라이언트가 그 디렉터리를 쓸 수 있습니다.

이제 account1 서버는 내보내기 파일에 다음 문을 더해 referral로 그 디렉터리를 클라이언트가 쓸 수 있게 할 수 있습니다.

text
/usr/doc -vers=4,refer=/usr/doc@publications

그런 다음 디렉터리를 내보냅니다. 이 시점에서 account1 서버의 / 디렉터리를 /mnt에 마운트한 클라이언트는 /mnt 디렉터리를 나열하면 usr 디렉터리에 접근할 수 있습니다. 클라이언트는 다른 서버를 마운트할 필요가 없습니다. 클라이언트 사용자는 거기 있는 파일을 account1 서버가 제공하지 않는다는 것을 알 필요도 없습니다. 예를 들어 data와 projects 서버에서 디렉터리를 내보내고 account1에 그 디렉터리로의 referral을 만들면, data 서버의 /databases/db와 projects 서버의 /home/accts 디렉터리를 account1을 거쳐 쓸 수 있게 할 수 있습니다.

클라이언트 사용자는 데이터의 실제 위치를 모르므로, 관리자는 서버의 내보내기 파일에서 referral 문만 바꿔 클라이언트를 한 서버에서 다른 서버로 보낼 수 있습니다. referral이 위치 지정으로 가리키는 데이터의 배치와 정확성은 관리자가 책임집니다.

관리자는 둘째 서버가 요청을 첫째 서버로 되돌려 순환 referral을 만들지 않게 해야 합니다. 위 예에서 관리자가 publications 서버의 /usr/doc에 account1 서버의 /usr/doc을 가리키는 referral을 만들었다면, 그 결과인 순환 referral은 바람직하지 않습니다.

referral은 exportfs로 만들지만 데이터 내보내기와는 다릅니다. referral에 지정하는 위치는 NFSv4로 내보낸 파일 시스템의 루트 디렉터리에 해당해야 합니다. referral은 내보낸 이름 공간 안에도, 내보내지 않은 이름 공간 안에도 만들 수 있습니다. 위 예에서 /usr을 내보내지 않았더라도 account1 서버에 /usr/doc referral을 만들 수 있습니다. 그러면 referral이 NFSv4 pseudo 공간 안에 놓입니다. account1이 /usr을 내보냈더라도 referral 내보내기는 허용됩니다. 반면 같은 파일 시스템 안에 있는 doc이라는 디렉터리를 내보내는 것은 실패했을 것입니다. 어느 경우든 /usr/doc에 파일이나 디렉터리가 있었다면 referral 내보내기는 실패했을 것입니다. 서버의 NFSv4 pseudo 공간 안이나 내보낸 파일 시스템 안에 만들 수 있는 referral 수에는 제한이 없습니다.

referral은 데이터를 내보내지 않고 NFSv4 프로토콜에만 의미가 있으므로 NFSv4에서만 쓸 수 있습니다. vers=4 옵션 없이 referral을 내보내면 실패합니다. 이 예에서는 위치를 하나만 지정했지만 8개까지 지정할 수 있습니다.

referral을 만들면 directory 매개변수가 지정한 위치에 특수 referral 객체가 만들어집니다. 클라이언트의 객체 접근은 객체의 부모 디렉터리에 대한 클라이언트 접근으로 정해지므로, 다른 내보내기 옵션 대부분은 의미가 없으며 허용되지만 무시됩니다. 유일한 예외는 exname 옵션이며 예상대로 동작합니다. 예를 들어 서버가 referral /n4root/special/users -vers=4,exname=/exported/users,refer=/restricted/users@secrethost를 만들면, 그 서버에서 / 를 마운트한 클라이언트는 /mnt/exported/users 경로를 보고, 이 경로는 클라이언트를 secrethost의 /restricted/users 디렉터리로 보냅니다. 내보내는 서버에서 referral 객체는 실제로 로컬 이름 공간의 /n4root/special/users에 만들어지므로, 내보낼 때 그 자리에 파일이나 디렉터리가 있으면 안 됩니다. referral 위치 정보를 담는 특수 객체가 서버에 만들어집니다. referral까지의 경로에 있는 디렉터리가 없으면 함께 만들어집니다. referral의 내보내기를 취소하면 객체에서 referral 정보는 지워지지만 객체 자체는 지워지지 않습니다. NFSv4 서버는 이렇게 남은 오래되거나 고아가 된 referral 객체에 클라이언트가 접근하는 것을 허용하지 않습니다. 객체에 접근하려는 클라이언트에 접근 오류를 돌려줍니다. 원하면 rm으로 객체를 지울 수 있습니다. referral은 새 referral 정보로 다시 내보낼 수 있습니다. referral에 접근한 클라이언트가 위치 정보가 바뀐 것을 알아차리는 데 시간이 걸릴 수 있으므로 자주 하는 것은 권하지 않습니다. 서버는 referral의 부모 디렉터리를 touch해 디렉터리 정보가 바뀌었음을 알립니다. 이것은 클라이언트가 디렉터리(와 그 안의 referral)에 관해 캐시한 정보가 바뀌었고 다시 가져와야 함을 알아차리는 데 도움이 되지만, 클라이언트가 알아차리는 데 얼마나 걸릴지는 보장하지 않습니다.

refer 옵션으로 파일 시스템 위치 목록에 지정한 위치의 순서를 바꾸는 방법은 scatter 옵션으로 위치 목록 순서 바꾸기를 봅니다.

영어 원문

NFS referrals

The following examples provide scenarios to help you understand referrals.

In the following examples, there are four servers:

  • The server called publications contains documentation files.

  • The server called projects contains user work directories.

  • The server called data contains information databases.

  • The server called account1 is the main NFS server that exports all other files, and is the server that all the clients know about.

Allowing all clients to access files on the main NFS server

Server account1 exports the directory /work to all clients using the following statement in the /etc/exports file:

text
/work -vers=4

All clients can access the files in the /work remote directory by mounting / from the account1 server onto the /mnt directory using the following command:

text
mount -o vers=4 account1:/ /mnt

When the user on the client lists the contents of the /mnt directory, they see the remote directory work at the path /mnt/work. The contents of the /mnt/work directory on the client is the same as the contents of the /work directory on the account1 server.

Allowing a client to access files on a specific server

The client user also wants to access the /usr/doc directory on the publications server.

In previous releases, you must export the directory from the server and mount the directory at the client.

Using referrals to build a distributed namespace

You can set up a server so that clients can access the data on other servers without the client knowing where the data is. Only the administrator on the referring server needs to know where the data is. The referring server can redirect clients to the location of the /usr/doc directory using a referral. On the server publications, the /usr/doc directory can be exported by adding the following statement to the export file:

text
/usr/doc -vers=4

This makes the directories available to NFSv4 clients.

The account1 server can now use referrals to make those directories available to clients by adding the following statement to the export file:

text
/usr/doc -vers=4,refer=/usr/doc@publications

You then export the directory. At this point, the client that mounted the /mnt directory from the / directory on the account1 server has access to the directory usr when the client lists the /mnt directory. The client does not have to perform any mounts to other servers. The client user does not even need to be aware that the files there are not being provided by the account1 server. For example, you can make the directories of /databases/db on server data and /home/accts on server projects available through account1 by exporting the directories from the data and projects servers, and creating referrals on account1 to those directories.

Because a client user is unaware of the actual location of the data, the administrator can redirect clients from one server to another simply by changing the referral statement in the exports file on the server. The administrator is responsible for the placement and correctness of data that referrals reference with their location specifications.

Administrators should make sure the second server will not refer the request back to the first server, creating a circular referral. In the above example, if the administrator had created a referral on the publications server at /usr/doc that referred to /usr/doc on the account1 server, the resulting circular referral would be undesirable.

Although referrals are created using exportfs, they are different from data exports. Locations specified for referrals should correspond to the root directories of NFSv4-exported file systems. You can create a referral within exported namespaces or in unexported namespaces. In the above example, the /usr/doc referral can be created on the account1 server even if /usr is not exported. This places the referral within the NFSv4 pseudospace. If account1 had exported /usr, the referral export would still have been allowed, in contrast to exporting a directory called doc, which would have failed if it were in the same file system. In either case, the referral export would have failed if a file or directory had existed at /usr/doc. There is no restriction on the number of referrals that can be created within either the server's NFSv4 pseudospace or within an exported file system.

Since a referral does not export any data and only has meaning to the NFSv4 protocol, referrals are available in NSFv4 only. Exporting a referral without the vers=4 option will fail. Although this example only specifies one location, up to 8 locations could have been specified.

Creating a referral creates a special referral object at the location specified by the directory parameter. Since client access to the object is determined by the client's access to the object's parent directory, most other export options have no meaning and are allowed and are ignored. The only exception is the exname option, which will have the expected behavior. For example, if the server creates the referral /n4root/special/users -vers=4,exname=/exported/users,refer=/restricted/users@secrethost, the clients that mount / from that server would see the path /mnt/exported/users, which would redirect the clients to the /restricted/users directory on secrethost. On the exporting server, the referral object would actually be created in the local namespace at /n4root/special/users, so no file or directory can exist there when the export is done. A special object gets created on the server to hold the referral location information. Any directories along the path to the referral will also be created if they do not exist. If the referral is unexported, the referral information will be removed from the object, but the object itself will not be removed. The NSFv4 server will not allow clients to access the resulting stale or orphan referral object. It will return an access error to clients that attempt to access the object. The object can be removed using rm, if desired. A referral can be re-exported with new referral information. This is not recommended as a frequent practice because it can take some time for clients that have accessed the referral to realize that the location information has changed. The server does touch the referral's parent directory to indicate that information in the directory has been changed. This helps the clients to realize that any information that the client has cached about the directory (and the referral within the directory) has changed and needs to be refetched, but there is no guarantee how long it will take for the clients to notice.

For information about using the refer option to change the order of the locations specified in the file system location list, see Reordering the file system location list using the scatter option.

NFS replica

복제를 쓰면 NFSv4 관리자는 여러 NFSv4 서버에 데이터 사본을 두고 NFSv4 클라이언트에 replica가 어디 있는지 알릴 수 있습니다.

주 데이터 서버에 클라이언트가 접근할 수 없게 되면, 클라이언트는 replica 서버 가운데 하나를 써서 복제된 파일 시스템에 대한 작업을 이어 갈 수 있습니다. replica 파일 시스템은 주 서버 데이터의 정확한 사본이라고 가정합니다. replica 위치는 8개까지 설정할 수 있습니다. AIX 서버는 replica 파일 시스템을 주 파일 시스템에서 어떻게 만들지, 데이터를 어떻게 일관되게 유지할지 정하지 않습니다. replica를 읽기-쓰기로 지정하려면 replica의 데이터를 주 파일 시스템과 일관되게 유지해야 합니다.

replica는 다른 서버의 디렉터리 사본을 가진 서버입니다. 주 서버를 클라이언트가 쓸 수 없게 되면 클라이언트는 replica 위치에서 같은 파일에 접근할 수 있습니다. 다음은 예 시나리오입니다.

account1 서버의 /data 디렉터리에 있는 파일을 inreserve 서버의 /backup/data 디렉터리에서도 쓸 수 있다면, 내보내기에 replica 위치를 지정해 NFSv4 클라이언트가 이를 알게 할 수 있습니다. 내보내기 파일에 다음과 비슷한 문을 더하면 /data 디렉터리를 내보내면서 replica 사본의 위치를 지정할 수 있습니다.

text
/data -vers=4,replicas=/data@account1:/backup/data@inreserve

account1 서버를 쓸 수 없게 되면, account1 서버의 /data 디렉터리 아래 파일을 쓰던 클라이언트 사용자는 클라이언트가 다른 서버로 바뀌었다는 것을 모른 채 inreserve 서버의 /backup/data 디렉터리 파일을 쓰기 시작할 수 있습니다.

replicas 옵션으로 파일 시스템 위치 목록에 지정한 위치의 순서를 바꾸는 방법은 scatter 옵션으로 위치 목록 순서 바꾸기를 봅니다.

replica 지정을 허용하는 NFS 구성 요건

root replica를 켜고, 끄고, 지정하려면 관리자여야 합니다.

root replica를 켜고, 끄고, 지정하려면 다음 명령을 씁니다.

text
chnfs -R {on|off|host[+host]}

replica를 지정하려면 서버가 휘발성(volatile) NFSv4 파일 핸들을 내도록 chnfs -R(chnfs -R on)로 구성되어 있어야 합니다. 파일 핸들은 NFS 서버가 서버의 파일이나 디렉터리를 식별하도록 클라이언트에 주는 식별자입니다. 기본으로 서버는 영구(persistent) 파일 핸들을 냅니다. 파일 핸들 종류를 바꾸면, 바꿀 때 서버를 활발히 쓰고 있는 NFSv4 클라이언트의 응용 프로그램에 오류가 생길 수 있습니다. chnfs -R로 파일 핸들 모드를 바꾸려면 NFSv4 접근용으로 내보낸 파일 시스템이 없어야 합니다. 파일 핸들 방식은 새로 준비한 NFS 서버에서 정하거나, NFS 활동을 최소화하거나 멈출 수 있을 때 정해야 합니다. 모드를 바꿀 때 서버에 활발히 연결된 클라이언트는 NFSv4 마운트를 마운트 해제했다가 다시 마운트해야 할 수 있습니다. 이 작업을 줄이려면 클라이언트 마운트 수를, NFSv4 서버가 내보낸 파일 공간의 최상위 디렉터리를 마운트하는 소수의 마운트로 줄일 수 있습니다.

NFSv4 클라이언트는 내보내기 접근 속성이 다른 replica로는 장애 조치할 수 없습니다. 관리자는 모든 replica를 같은 내보내기 접근 제어와 접근 모드(읽기 전용이나 읽기-쓰기)로 지정해야 합니다. GPFS를 내보내는 경우를 빼면 복제 데이터는 읽기 전용으로 내보낸다고 봅니다. 모든 replica 위치의 데이터 내용을 유지하는 것도 관리자의 책임입니다. 디렉터리 트리와 모든 데이터 내용은 똑같이 유지해야 합니다. 데이터 내용 갱신은 그 데이터를 쓸 응용 프로그램과 가장 잘 맞는 방식으로 해야 합니다.

replica에서는 exname 내보내기 옵션으로 서버의 로컬 파일 시스템 이름 공간의 세부 사항을 NFSv4 클라이언트에게서 감출 수 있습니다. 자세한 내용은 Commands Reference, Volume 2의 exportfs 명령 설명과 Files Reference의 /etc/exports 파일 설명을 봅니다.

GPFS(General Parallel File System) 같은 클러스터 파일 시스템을 내보낼 때 replicas 옵션으로 같은 GPFS 뷰를 보는 여러 NFS 서버 노드를 지정할 수 있습니다. 이런 구성에서는 데이터를 읽기-쓰기로 내보내는 것이 타당할 수 있습니다. 그러나 읽기-쓰기 replica에서 쓰기 작업 도중 replica 장애 조치가 일어나면, 쓰기를 하는 응용 프로그램이 복구할 수 없는 오류를 만날 수 있습니다. 마찬가지로 장애 조치 중에 실행되는 mkdir이나 배타적 파일 생성 작업은 EXISTS 오류를 만날 수 있습니다.

복제 내보내기는 파일 시스템 전체를 내보내야 합니다. 곧 내보내는 디렉터리가 로컬 파일 시스템의 루트여야 합니다. 복제 파일 시스템을 내보내는 서버는 자기 자신을 내보내기 위치 가운데 하나로 지정해야 합니다. 인터페이스가 여럿인 서버라면 서버의 주 호스트 이름을 넣어야 합니다. 복제 파일 시스템을 내보내는 서버가 자기를 위치로 지정하지 않으면, 내보내는 서버가 replica 위치 목록의 첫째 위치로 조용히 더해집니다. replica 목록의 위치 순서는 클라이언트가 장애 조치할 때 쓸 선호 순서를 지정합니다. 예를 들어 serverA의 사용자가 /webpages를 내보내려 하고, serverB의 /backup/webpages 디렉터리에 /webpages의 replica가 있다면, /etc/exports 파일의 다음 항목은 serverA에서 /webpages를 내보내고 클라이언트에 serverB의 /backup/webpages에 파일 시스템 사본이 있음을 알립니다.

text
/webpages -vers=4,ro,replicas=/webpages@serverA:
/backup/webpages@serverB

serverA의 /webpages와 serverB의 /backup/webpages는 모두 각 파일 시스템의 루트 디렉터리라고 가정합니다. 내보내기에 serverA를 적지 않았다면 첫째 replica 위치로 조용히 더해졌을 것입니다. 데이터를 내보내는 서버가 그 데이터의 선호 서버라고 가정하기 때문입니다.

replica는 NFSv4 프로토콜만 씁니다. 위 내보내기에 NFSv3(vers=3:4)를 지정할 수도 있었지만, 복제 정보는 NFSv3 클라이언트에 주어지지 않습니다. 그러나 NFSv3 클라이언트도 serverA의 /webpages 정보에 접근할 수는 있으며, 다만 serverA를 쓸 수 없게 되어도 replica로 장애 조치하지 않습니다.

여러 위치에 대한 NFS 클라이언트 쪽 지원

클라이언트가 지금 서버에서 복제 데이터에 더는 접근할 수 없으면, 다음으로 선호하는 서버에서 데이터에 접근하려 합니다.

클라이언트는 replicas 목록에 replica를 지정한 순서를 선호 순서로 받아들입니다.

클라이언트 관리자는 nfs4cl 명령의 prefer 하위 명령으로 replica 선호를 바꿀 수 있습니다. nfs4cl 명령은 클라이언트의 모든 파일 시스템 정보를 보여 주거나 파일 시스템의 옵션을 바꾸고, 현재 NFSv4 통계와 속성을 보여 주거나 바꿉니다.

replica와 referral의 공통 고려 사항

클라이언트가 같은 데이터(파일 시스템)로 이어지는 서로 다른 두 경로를 만나면, 둘째 경로를 파일에 대한 심볼릭 링크로 다룹니다.

예를 들어 server A가 다음을 내보냅니다.

text
/tmp/a               -vers=4,replicas=/tmp/a@B:/tmp/a@A
/tmp/b               -vers=4,refer=/tmp/a/b@B

그리고 server B가 다음을 내보냅니다.

text
/tmp/a               -vers=4
/tmp/a/b             -vers=4

이 예에서 클라이언트는 mount -o vers=4 A:/ /mnt 명령으로 server A의 / 를 /mnt에 마운트합니다. 클라이언트 사용자는 cd /mnt/tmp/a/b나 cd /mnt/tmp/b로 server B의 /tmp/a/b에 접근합니다. 사용자가 먼저 cd /mnt/tmp/a/b로 디렉터리를 바꾸면 /mnt/tmp/b 경로는 /mnt/tmp/a/b에 대한 심볼릭 링크처럼 동작합니다. 이 시나리오에서 사용자가 /mnt/tmp/b에 있으면서 /bin/pwd 명령을 쓰면 /bin/pwd는 /mnt/tmp/a/b를 돌려줍니다.

참고: 위와 같은 방식은 권하지 않습니다. 관리자는 내보낸 데이터로 가는 이름 공간 경로가 하나만 생기도록 내보내기를 지정해야 합니다.

referral의 대상 데이터가 실제로 복제되어 있다면 referral에 여러 위치를 나열할 수 있습니다. 클라이언트는 쓸 수 있는 서버에서 referral 대상을 찾는 데만 referral 위치를 씁니다. referral 대상에 접근하게 되면 찾은 데이터의 새 위치 정보를 얻습니다.

클라이언트가 referral 위치 정보의 변경을 바로 감지하지 못할 수 있으므로, referral 위치를 자주 지우거나 바꾸는 것은 권하지 않습니다. 참조 위치의 대상을 옮길 때는 내보내기의 referral 지정에서 위치 정보를 바꾸면서 새 위치에 데이터를 채워 두기를 권합니다. 클라이언트가 새 위치를 보고 쓸 시간을 주도록 옛 위치의 데이터를 몇 시간이나 며칠 동안 남겨 둡니다.

복제와 referral은 모두 64비트 커널을 실행하는 서버에서만 동작합니다. 클라이언트는 32비트와 64비트 커널 모두에서 실행할 수 있습니다.

replica를 읽기-쓰기로 지정하려면 replica의 데이터를 주 파일 세트와 일관되게 유지해야 합니다.

NFS 클라이언트가 장애 조치하는 방법

장애 조치(fail-over)는 클라이언트가 통신하고 있는 현재 서버에 더는 접근할 수 없다고 판단한 뒤 한 replica 위치에서 다른 위치로 바꾸는 것입니다.

다음 조정 값이 NFS 클라이언트의 장애 조치 동작에 영향을 줍니다.

조정 값 설명
NFS 마운트 옵션 timeo TCP/IP 계층이 시간 초과 응답으로 돌아오기 전에 기다려야 하는 시간을 지정합니다.
NFS 마운트 옵션 retrans NFS RPC 계층이 RPC 시간 초과 오류(ETIMEDOUT)를 돌려주기 전에 클라이언트 요청을 다시 시도할 횟수를 지정합니다.
nfso 옵션 nfs_v4_fail_over_timeout 클라이언트가 replica로 장애 조치하기 전에 기다려야 하는 최소 시간을 지정합니다. NFS 클라이언트 전역 옵션이며 마운트별 기본 동작보다 우선합니다. 기본으로 활성이 아니며 값은 0입니다.

nfs_v4_fail_over_timeout이 활성이 아니면 장애 조치 임계값은 마운트 timeo 옵션 값의 두 배로 설정됩니다. 이 시간 동안 성공한 RPC 호출이 없으면 클라이언트는 쓸 수 있는 다른 replica를 찾는 장애 조치 처리를 시작합니다. 그러나 클라이언트가 실제로 기다리는 시간은 retrans 옵션의 영향을 받습니다. retrans가 2보다 크면 클라이언트는 retrans 값에 timeo 값을 곱한 값(retrans × timeo)을 바탕으로 한 RPC 시간 초과를 받을 때까지 기다릴 가능성이 큽니다. 그래서 timeo와 retrans 옵션의 조합으로 NFS 마운트마다 장애 조치 동작을 조정할 수 있습니다. nfs4cl 명령으로 더 세밀한 수준에서 이 옵션을 설정할 수도 있습니다.

nfso nfs_v4_fail_over_timeout이 0이 아닌 값으로 설정되면, 그 값은 클라이언트가 replica 장애 조치를 고려하기 전에 쓸 수 없는 서버를 기다리는 초를 나타냅니다. timeo와 retrans 옵션으로 RPC 시간 초과가 nfso 설정보다 늦게 일어나면, RPC 시간 초과가 생길 때까지 장애 조치 처리가 시작되지 않을 수 있습니다.

retrans, timeo, nfs_v4_fail_over_timeout 옵션에 관한 자세한 정보는 mount, nfs4cl, nfso 명령의 NFS 전용 옵션을 봅니다.

쓸 수 없는 서버 때문의 replica 장애 조치 말고도, 클라이언트가 스스로 한 replica 위치에서 다른 위치로 바꾸는 경우가 있습니다. 하나는 nfs4cl 명령으로 선호 replica를 정했을 때입니다. 이 경우 선호 서버가 클라이언트가 지금 쓰는 서버가 아니면 클라이언트가 선호 서버로 바꾸기 시작합니다. 또 관련 데이터에 최근 활동이 있으면 클라이언트는 약 30분 간격으로 NFS 서버에서 replica 위치 정보를 다시 가져옵니다. 위치 순서가 바뀌었으면, 첫째 위치가 클라이언트가 지금 쓰는 서버와 다르고 nfs4cl 명령으로 replica 선호를 정하지 않았다면 클라이언트가 첫째 위치로 바꾸려 합니다.

soft NFS 마운트와 장애 조치 동작

NFS의 기본 마운트 모델은 hard 마운트이며 replica 장애 조치 동작은 hard 마운트에 적용됩니다. NFS soft 마운트를 쓰면 장애 조치 동작이 다릅니다.

soft 마운트 설정 때문에 replica 장애 조치를 위해 정한 대기 시간보다 먼저 RPC 시간 초과가 일어나면, 시간 초과가 호출한 응용 프로그램에 ETIMEDOUT 오류로 돌아갑니다. 복제 데이터에 soft 마운트를 쓰는 것은 권하지 않습니다. soft 마운트를 쓰고 nfso nfs_v4_fail_over_timeout 값을 설정했다면, retrans와 timeo 마운트 옵션을 nfso 설정보다 길게 설정하기를 권합니다. 그러면 복제 데이터에 대해 응용 프로그램에 ETIMEDOUT이 돌아가는 것을 피할 수 있습니다.

영어 원문

NFS replicas

Replication allows you, as the NFSv4 administrator, to place copies of data on multiple NFSv4 servers and inform NFSv4 clients where the replicas reside.

In the event that the primary data server becomes inaccessible to the clients, the clients can use one of the replica servers to continue operations on the replicated file system. The replica file systems are assumed to be exact copies of the data on the primary server. You can set up to 8 replica locations. The AIX server does not specify how the replica file systems are created from the primary file system or how the data is kept coherent. If you are going to specify replicas as read-write, you must keep the data on the replicas coherent with the primary file system.

A replica is a server that contains a copy of the directory or directories of another server. If the primary server becomes unavailable to the client, the client can access the same files from a replica location. The following scenario is an example:

If the files in the /data directory on the account1 server are also available in the /backup/data directory on the server inreserve, the NSFv4 clients could be made aware of this by specifying replica locations on the export. By adding a statement similar to the following one in the export file, you can export the /data directory and specify the location of the replica copy:

text
/data -vers=4,replicas=/data@account1:/backup/data@inreserve

If the account1 server becomes unavailable, client users using files under the /data directory of the account1 server can begin using files in the /backup/data directory on the inreserve server, without being aware that the client has switched to a different server.

For information about using the replicas option to change the order of the locations specified in the file system location list, see Reordering the file system location list using the scatter option.

NFS configuration requirements to allow specification of replicas:

You must be an administrator to enable, disable, or specify root replicas.

To enable, disable, and specify root replicas, use the following command:

text
chnfs -R {on|off|host[+host]}

In order to specify replicas, the server must be configured with chnfs -R (chnfs -R on) to issue volatile NFSv4 file handles. A file handle is an identifier that NFS servers issue to clients to identify a file or directory on the server. By default, the server issues persistent file handles. Switching between file handle types can result in errors to applications at NFSv4 clients that are actively using the server when the switch is performed. In order to change the file handle mode with chnfs -R, no file systems can be exported for NFSv4 access. Setting the file handle disposition should be done with a newly-provisioned NFS server or done when NFS activity can be minimized or stopped. For clients actively connected to servers when the mode is changed, it may be necessary to unmount and remount NFSv4 mounts on those clients. To minimize this action, the number of client mounts can be reduced to a small number of mounts that mount the top-level directories of an NFSv4 server's exported file space.

The NFSv4 client cannot fail over to replicas with different export access properties. Administrators must make sure that all replicas are specified with the same export access controls and access mode (read-only or read-write). With the possible exception of exported GPFS™, it is expected that replicated data will be exported read-only. It is also the administrator's responsibility to maintain the data content at all replica locations. Directory trees and all data content should be kept identical. Updates to data content will need to be performed in a manner that is most compatible with the applications that will be using the data.

With replicas, you can use the exname export option to hide details of the server's local file system namespace from NFSv4 clients. For more details, see the exportfs command description in Commands Reference, Volume 2 and the /etc/exports file description in Files Reference.

You can use the replicas option with the export cluster file systems such as General Parallel File System (GPFS) to specify multiple NFS server nodes that see the same GPFS view. This is a configuration where exporting the data for read-write access may be valid. However, with read-write replicas, if a replica failover occurs while write operations are in progress, applications performing the write may encounter unrecoverable errors. Similarly, a mkdir or exclusive file create operation running during a failover may encounter an EXISTS error.

A replicated export must export an entire file system. This means that the directory being exported must be the root of the local file system. The server exporting a replicated file system should specify itself as one of the locations for the export. For servers with multiple interfaces, this must include the server's

primary host name. If the server exporting a replicated file system does not specify itself as one of the locations for export, the exporting server will be silently added to the list of replica locations as the first replica location. The order of replica locations in the replica list specifies the order of preference the clients should use when failing over. For example, if the user at serverA wants to export /webpages, and there is a replica of /webpages on serverB in the /backup/webpages directory, the following entry in the /etc/exports file will export /webpages from serverA and inform clients that there is a copy of the file system on serverB at /backup/webpages:

text
/webpages -vers=4,ro,replicas=/webpages@serverA:
/backup/webpages@serverB

Both /webpages on serverA and /backup/webpages on serverB are assumed to be the root directories of their file systems. If serverA had not been listed in the export, it would have been silently added as the first replica location. This is because the server exporting the data is assumed to be the preferred server for the data it is exporting.

Replicas are only used by the NFSv4 protocol. The above export could have specified NFSv3 (vers=3:4), but the replication information would not be available to NFSv3 clients. Clients using NFSv3 can, however, access the information in /webpages on serverA, but they will not fail over to the replica if serverA becomes unavailable.

NFS client-side support for multiple locations

When the client can no longer access replicated data from its current server, the client attempts to access the data from the next-most-favored server.

The order in which the replicas are specified in the replicas list is taken by the client to be the order of preference.

The client administrator can override the replica preference using the prefer subcommand of the nfs4cl command. The nfs4cl command displays all the file system information on the client or modifies file system options of a file system and displays or modifies current NFSv4 statistics and properties.

NFS common considerations for replicas and referrals

If the client encounters two different paths leading to the same data (file system), the client treats the second path as a symbolic link to the file.

For example, server A exports:

text
/tmp/a               -vers=4,replicas=/tmp/a@B:/tmp/a@A
/tmp/b               -vers=4,refer=/tmp/a/b@B

And server B exports:

text
/tmp/a               -vers=4
/tmp/a/b             -vers=4

In this example, the client mounts / on server A onto /mnt by using the command mount -o vers=4 A:/ /mnt. The client user accesses /tmp/a/b on server B through cd /mnt/tmp/a/b or cd /mnt/tmp/b. If the user changes the directory to cd /mnt/tmp/a/b first, then the path /mnt/tmp/b acts as a symbolic link to /mnt/tmp/a/b. In this scenario, if the user is in /mnt/tmp/b and uses the command /bin/pwd, /bin/pwd > will return /mnt/tmp/a/b.

Note: The above practice is not recommended. The administrator should set up export specifications that result in only one possible namespace path to exported data.

You can list multiple locations in referrals if the target data of the referral is actually replicated. Clients will only use the referral locations to find the referral target at an available server. Once the client establishes access to the referral target, it will obtain new location information for the found data.

Since clients may not immediately detect changes on referral location information, removing or changing referral location frequently is not recommended. When relocating the target of a reference location, it is suggested that the new location be populated along with changing the location information in the export's referral specification. The data at the old location should be kept for several hours or even days to give clients time to see and use the new location.

Both replication and referrals can only run on servers running the 64-bit kernel. Clients can run on both the 32- and 64-bit kernels.

If you are going to specify replicas as read-write, you must keep the data on the replicas coherent with the primary fileset.

How NFS clients fail over

A fail-over is when the client switches from one replica location to another after it determines that the current server it is communicating with is no longer accessible.

The following tunables influence the NFS client fail-over behavior:

NFS mount option timeo

This mount option specifies the time that the TCP/IP layer must wait before it returns with a timeout response.

NFS mount option retrans

This mount option specifies the number of times the NFS RPC layer should retry the client's request before returning an RPC timeout error (ETIMEDOUT).

nfso option nfs_v4_fail_over_timeout

You can use this nfso option to specify the minimum amount of time the client must wait before failing over to a replica. This option is global to the NFS client and overrides the default per mount behavior. By default, the nfs_v4_fail_over_timeout is not active. It's value is 0.

When nfs_v4_fail_over_timeout is not active, the fail-over threshold is set to twice the mount timeo option value. When no successful RPC calls have occurred for this duration, the client will begin fail-over processing to find another available replica. However, the actual time the client will wait is influenced by the retrans option. If retrans is greater than 2, the client will likely wait until it receives an RPC timeout based on the retrans value times the timeo value (retrans × timeo). Therefore, the combination of the timeo and retrans options can be adjusted to control fail-over behavior on a per-NFS mount basis. You can also set these options at a more granular level by using the nfs4cl command.

When nfso nfs_v4_fail_over_timeout is set to a non-zero value, it represents the number of seconds the client will wait on an unavailable server before considering replica fail-over. If the timeo and retrans options result in RPC timeout behavior beyond the nfso setting, fail-over processing may not start until the RPC timeout is generated.

For more information about the retrans, timeo, and nfs_v4_fail_over_timeout options, refer to the NFS-specific options of the mount, nfs4cl, and nfso commands.

In addition to replica fail-over in the event of an unavailable server, there are cases where the client will voluntarily switch from one replica location to another. One case is when you use the nfs4cl command to establish a preferred replica. In this case, the client initiates a switch to the preferred server, if that is not the current server the client is using. The client will also refetch replica location information from the NFS server on approximately 30 minute intervals when there has been recent activity on the associated data. If

the ordering of the locations has changed, the client attempts to switch to the first location, if that is different from the current server the client is using and you have not set a replica preference with the nfs4cl command.

Soft NFS mounts versus failover behavior

The default mount model for NFS is hard mounts and the replica failover behavior applies to hard mounts. Failover behavior is different if NFS soft mounts are used.

If the soft mount settings result in an RPC timeout prior to the established wait period for replica failover, then the timeout will result in an ETIMEDOUT error to the calling application. The use of soft mounts with replicated data is not recommended. If soft mounts are used and the nfso nfs_v4_fail_over_timeout value has been set, it is suggested that the retrans and timeo mount options be set to exceed the nfso setting. This will avoid ETIMEDOUT returns to applications for replicated data.

scatter 옵션으로 파일 시스템 위치 목록 순서 바꾸기

exportfs 명령의 scatter 옵션으로, exportfs 명령의 refer 옵션이나 replicas 옵션으로 정한 파일 시스템 위치 목록에 지정한 위치의 순서를 바꿀 수 있습니다.

이 옵션을 쓰면 서버 위치의 서로 다른 조합을 만들어, 목록마다 선호 순서의 서버가 다르게 됩니다. 그 결과 클라이언트마다 서버 위치 목록이 다릅니다. 클라이언트마다 위치 목록의 첫 서버가 다르므로 이 순서 바꾸기는 부하 분산에 도움이 됩니다. 또 서버가 꺼지면 서버 위치 목록의 다음 위치에 있는 서버가 다르므로 장애 조치 부하가 여러 서버에 나뉩니다. scatter 옵션은 NFS 버전 4 프로토콜로 접근하도록 내보낸 디렉터리에만 적용됩니다.

scatter 옵션의 값은 다음과 같습니다.

값 설명
full 모든 서버의 순서를 바꿔 다른 위치 조합을 만듭니다. 조합의 총수는 12와 서버 수 가운데 큰 쪽으로 제한됩니다.
partial 만들어지는 모든 서버 조합의 첫 위치는 서버 목록의 첫 서버로 고정합니다. 나머지 위치는 full로 바꾼 것처럼 나열합니다.
none 파일 시스템 위치 목록의 순서를 바꾸지 않습니다. scatter 옵션의 기본값입니다. 이전의 순서 바꾸기를 끄려면 이 값을 씁니다.

참고: exportfs 명령을 쓸 때 noauto 플래그를 지정하지 않으면 위치 목록에 주 호스트 이름이 replica 위치 가운데 하나로 들어갑니다. noauto 플래그에 관한 자세한 정보는 Commands Reference, Volume 2의 exportfs 명령을 봅니다.

호스트 s1, s2, s3에 /common/documents 디렉터리의 referral을 지정하고 full 옵션으로 순서를 바꾸려면 /etc/exports 파일에 다음 줄을 더한 뒤 /common/documents 디렉터리를 내보냅니다.

text
/common/documents -ver=4, refer=/common/documents@s1:/common/document@s2a:/common/
documents@s3,scatter=full

호스트 s1, s2, s3, s4에 /common/documents 디렉터리의 replica를 지정하고 부분적으로 순서를 바꾸려면(모든 조합의 첫 장애 조치 서버는 s1) /etc/exports 파일에 다음 줄을 더한 뒤 /common/documents 디렉터리를 내보냅니다.

text
/common/documents -vers=4, replicas=/common/documents@s1:/common/documents@s2:/common/
   documents@s3:/common/documents@s4,scatter=partial
영어 원문

Reordering the file system location list using the scatter option

The scatter option of the exportfs command enables you to change the order of the locations specified in the file system location list that is set with either the refer option or the replicas option of the exportfs command.

Using this option generates different combinations of server locations so that different lists have different servers in the order of preference. Consequently, different clients have server location lists that are different. This reordering helps load balancing because the first server in the location list of different clients is a different server. Also, if a server goes down, the fail-over load is distributed across multiple servers because the server in the next location in the server locations list is different. The scatter option applies only to directories exported for access by the NFS version 4 protocol.

The scatter option can have the following values:

  • full - All of the servers are reordered to form combinations of alternate locations. The total number of combinations is limited to either 12 or the number of servers, whichever number is higher.

  • partial - The first location for all of the server combinations generated is fixed to the first server in the server list. The rest of the locations are listed as if a full reordering is used.

  • none - No reordering of the file system location list is done. This is the default value for the scatter option. Use this value to disable any previous reordering of the location list.

Note: If the noauto flag is not specified when you are using the exportfs command, then the location list includes the primary host name as one of the replica locations. For more information about the noauto flag, see the exportfs command in Commands Reference, Volume 2.

To specify referrals for the /common/documents directory at hosts s1, s2, and s3, and then reorder them using the full option, add the following line to the /etc/exports file and then export the /common/documents directory:

text
/common/documents -ver=4, refer=/common/documents@s1:/common/document@s2a:/common/
documents@s3,scatter=full

To specify replicas for the /common/documents directory at hosts s1, s2, s3, and s4, and reorder them partially (first fail-over server is s1 for all combinations), add the following line to the /etc/exports file and then export the /common/documents directory:

text
/common/documents -vers=4, replicas=/common/documents@s1:/common/documents@s2:/common/
   documents@s3:/common/documents@s4,scatter=partial

NFS 서버-클라이언트 위임

위임(delegation)은 서버가 특정 책임을 클라이언트에 넘기는 기능입니다.

AIX 5L Version 5.3 with the 5300-03 Recommended Maintenance package부터 위임을 쓸 수 있습니다. 서버가 클라이언트에 파일 위임을 주면 클라이언트는 그 파일을 다른 클라이언트와 나눠 쓰는 것에 관한 특정 의미를 보장받습니다. 파일을 열 때 서버는 클라이언트에 그 파일의 읽기 위임을 줄 수 있습니다. 클라이언트가 읽기 위임을 받으면 위임 기간 동안 다른 어떤 클라이언트도 파일에 쓸 수 없음이 보장됩니다. 쓰기 위임을 받으면 다른 어떤 클라이언트도 파일에 읽기나 쓰기 접근을 갖지 않음이 보장됩니다. AIX 서버는 읽기 위임만 줍니다. AIX 서버는 64비트 AIX 커널에서만 위임을 지원합니다. AIX 클라이언트는 읽기와 쓰기 위임을 모두 지원합니다.

서버가 클라이언트에 위임을 주려면 클라이언트가 먼저 서버에 콜백 주소를 줘야 합니다. 위임을 회수할 때 서버는 이 주소로 회수 요청을 보냅니다. 기본으로 클라이언트는 서버와의 보통 통신에 쓰는 IP 주소를 알립니다. 네트워크 인터페이스가 여럿인 클라이언트는 /etc/nfs/nfs4_callback.conf 파일에 특정 주소를 지정할 수 있습니다. 이 파일의 항목 형식은 다음과 같습니다.

text
server-host client-ip-address

여기서 server-host는 NFSv4 서버의 이름이나 주소이고, client-ip-address는 서버에 콜백 정보를 줄 때 쓸 클라이언트 주소입니다. server-host 이름이 IPv4 주소 0.0.0.0이나 IPv6 주소 0::0이면 지정한 client-ip-address를 파일에 나열되지 않은 모든 서버에 씁니다. 이 파일이 없거나 서버 항목(또는 기본 항목)을 찾지 못하면 클라이언트는 서버와의 기존 연결을 바탕으로 주소를 고릅니다.

서버는 위임을 회수할 수 있습니다. 다른 클라이언트가 준 위임과 충돌하는 방식으로 파일 접근을 요청하면, 서버는 처음 클라이언트에 알리고 위임을 회수할 수 있습니다. 이를 위해서는 서버와 클라이언트 사이에 콜백 경로가 있어야 합니다. 콜백 경로가 없으면 위임을 줄 수 없습니다. 파일 위임을 주었으면, 다른 NFSv4 클라이언트, NFS 버전 2와 3 클라이언트의 접근, 파일 서버에서의 로컬 접근이 위임 회수를 일으킬 수 있습니다. GPFS를 NFSv4로 내보내고 있으면 네트워크의 GPFS 노드에서의 접근이 위임 회수를 일으킬 수 있습니다.

위임의 핵심은 클라이언트가 OPEN, CLOSE, LOCK, LOCKU, READ, WRITE 같은 작업을 서버와 바로 상호 작용하지 않고 로컬에서 처리하게 하는 것입니다.

서버 위임은 기본으로 켜져 있습니다. 서버 위임은 nfso -o server_delegation=0 명령으로 끌 수 있습니다. 관리자는 exportfs의 deleg=yes 또는 deleg=no 옵션으로 파일 시스템마다 위임 허용을 끄거나 켤 수 있으며, 이 설정이 nfso 설정보다 우선합니다.

클라이언트 위임은 nfso -o client_delegation=0 명령으로 끌 수 있습니다. 클라이언트 위임은 클라이언트에서 마운트가 일어나기 전에 설정해야 합니다.

많은 클라이언트가 많은 공통 파일에 쓰는 파일 시스템을 내보낸다면 관리자는 그 파일 시스템의 위임을 끄고 싶을 수 있습니다.

클라이언트에 연락할 수 없으면(예를 들어 네트워크나 클라이언트가 중단되면) 다른 클라이언트가 데이터에 접근하는 것이 늦어질 수 있습니다.

영어 원문

NFS server-client delegation

Delegation is the ability of the server to delegate certain responsibilities to the client.

Beginning with AIX 5L Version 5.3 with the 5300-03 Recommended Maintenance package, you can use delegation. When the server grants a delegation for a file to a client, the client is guaranteed certain semantics with respect to sharing that file with other clients. When a file is opened, the server can provide the client a read delegation for the file. If the client is granted a read delegation, it is assured that no other client has the ability to write to the file for the duration of the delegation. If the client is granted a write delegation, the client is assured that no other client has read or write access to the file. The AIX server only grants read delegations. The AIX server only supports delegation with the 64-bit AIX kernel. The AIX client supports both read and write delegations.

In order for the server to grant a delegation to the client, the client must first provide a callback address to the server. When a delegation is recalled, the server will send the recall request to this address. By default, the client will indicate the IP address that is being used for normal communication with the server. For clients with multiple network interfaces, a specific address can be specified in the /etc/nfs/nfs4_callback.conf file. The format of the entries in this file is:

server-host client-ip-address

Where server-host is the name or address of an NFSv4 server and client-ip-address is the client address to be used when providing the server callback information. If the server-host name is the IPv4 address 0.0.0.0 or the IPv6 address 0::0, the specified client-ip-address will be used for all servers that are not listed in the file. If this file does not exist, or if an entry for the server (or a default entry) is not found, the client selects an address based on the existing connection to the server.

Delegations can be recalled by the server. If another client requests access to the file in such a way that the access conflicts with the granted delegation, the server is able to notify the initial client and recall the delegation. This requires that a callback path exists between the server and client. If this callback path does not exist, then delegations cannot be granted. If a file delegation has been granted, access from other NFSv4 clients, NFS versions 2 and 3 clients, and local accesses to the file at the file server can cause the delegation to be recalled. If GPFS is being NFSv4 exported, an access at a GPFS node in the network may cause the delegation to be recalled.

The essence of a delegation is that it allows the client to locally service operations such as OPEN, CLOSE, LOCK, LOCKU, READ, and WRITE without immediate interaction with the server.

Server delegation is enabled by default. Server delegation can be disabled with the nfso -o server_delegation=0 command. Administrators can use the exportfs deleg=yes | no option to disable or enable the granting of delegations on a per-file system basis, which will override the nfso setting.

Client delegation can be disabled with the nfso -o client_delegation=0 command. Client delegation must be set before any mounts take place on the client.

If the administrator is exporting a file system where many clients will be writing to many common files, the administrator may want to disable delegations for that file system.

If the client cannot be contacted (for example, if the network or client is experiencing an outage) other clients may be delayed in accessing the data.

Kerberos로 보호하는 콜백 경로용 일반 호스트 주체 만들기

IBM Network Authentication Service(Kerberos)용 콜백 경로를 설정할 수 있습니다.

위임을 받는 클라이언트는 자기 호스트 주체가 있는 완전한 클라이언트여야 합니다. 그러나 모든 클라이언트가 콜백에 쓸 일반 호스트 주체를 만들 수 있습니다.

모든 클라이언트가 콜백에 쓸 일반 호스트 주체를 만들려면 다음 단계를 따릅니다.

  1. 호스트 주체를 만드는 것과 같은 방법으로 서비스 주체(예: nfs/client)를 만들려면 Security의 Creating a Kerberos principal을 봅니다.
  2. 그 서비스 주체의 keytab 항목을 만듭니다. 예를 들어 slapd_krb5.keytab이라는 keytab을 만들려면 다음과 같이 합니다.
text
kadmin.local: ktadd -k /etc/security/slapd_krb5.keytab ldap/plankton.austin.ibm.com
Entry for principal ldap/plankton.austin.ibm.com with kvno 2,
encryption type Triple DES cbc mode with HMAC/sha1 added to keytab
WRFILE:/etc/security/slapd_krb5.keytab.
Entry for principal ldap/plankton.austin.ibm.com with kvno 2,
encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/etc/security/slapd_krb5.keytab.
Entry for principal ldap/plankton.austin.ibm.com with kvno 2,
encryption type AES-256 CTS mode with 96-bit SHA-1 HMAC added to keytab
WRFILE:/etc/security/slapd_krb5.keytab.
Entry for principal ldap/plankton.austin.ibm.com with kvno 2,
encryption type DES cbc mode with RSA-MD5 added to keytab WRFILE:/etc/security/slapd_krb5.keytab.
kadmin.local:
  1. 이 keytab을 쓸 모든 클라이언트에 배포합니다.
  2. nfshostkey 명령으로 클라이언트를 구성합니다.

이 과정은 Kerberos와 함께 쓸 서버를 구성하는 과정과 같지만, 일반 주체는 서버에 쓸 수 없습니다. 각 서버에는 nfs/hostname 형식의 자기 주체가 있어야 합니다.

영어 원문

Establishing generic host principals for Kerberos-protected callback paths

You can set up a callback path for IBM Network Authentication Service (Kerberos).

The client receiving the delegation must be a full client with its own host principal. However, you can establish a generic host principal for all clients to use for callbacks.

To establish a generic host principal for all clients to use for callbacks, perform these steps:

  1. To create a service principal (for example, nfs/client) using the same method used to create a host principal, refer to Creating a Kerberos principal in Security.

  2. Create a keytab entry for that service principal. For example, to create a keytab called slapd_krb5.keytab, do the following:

text
kadmin.local: ktadd -k /etc/security/slapd_krb5.keytab ldap/plankton.austin.ibm.com
Entry for principal ldap/plankton.austin.ibm.com with kvno 2,
encryption type Triple DES cbc mode with HMAC/sha1 added to keytab
WRFILE:/etc/security/slapd_krb5.keytab.
Entry for principal ldap/plankton.austin.ibm.com with kvno 2,
encryption type ArcFour with HMAC/md5 added to keytab WRFILE:/etc/security/slapd_krb5.keytab.
Entry for principal ldap/plankton.austin.ibm.com with kvno 2,
encryption type AES-256 CTS mode with 96-bit SHA-1 HMAC added to keytab
WRFILE:/etc/security/slapd_krb5.keytab.
Entry for principal ldap/plankton.austin.ibm.com with kvno 2,
encryption type DES cbc mode with RSA-MD5 added to keytab WRFILE:/etc/security/slapd_krb5.keytab.
kadmin.local:
  1. Distribute this keytab to all clients that will use it.

  2. Configure the clients with the nfshostkey command.

This process is identical to the process for configuring a server for use with Kerberos, but the generic principal cannot be used for servers; each server must have its own principal of the form nfs/hostname.

STNFS 단기 네트워크 파일 시스템(6.1)

STNFS(Short Term Network File Systems) 파일 시스템은 NFS(Network File System)를 바탕으로 하는 파일 시스템이며, 파일을 로컬에서 바꿀 수 있게 합니다. 바꾼 내용은 서버에 저장되지 않습니다.

주:

  1. 많은 STNFS 클라이언트가 서버의 같은 파일 시스템 이미지를 나눠 쓸 수 있지만, 바꾼 내용은 바꾼 클라이언트에게만 보입니다.
  2. 클라이언트가 바꾼 내용은 파일 시스템을 마운트 해제하거나 클라이언트를 다시 부팅하면 사라집니다.
  3. 시스템 메모리가 미리 정한 임계값 아래로 떨어지면 STNFS의 쓰기 작업이 실패합니다. 이 임계값은 STNFS 내부 값이며 밖에서 구성할 수 없습니다.
영어 원문

STNFS short-term network file systems

An Short Term Network File Systems (STNFS) file system is a file system backed up by a Network File System (NFS), and the STNFS file system allows local modification to files. The modifications are not saved on the server.

Notes

1 Many STNFS clients can share the same file system image from a server, but any modifications are seen only by the client making the modification. 2 Any modifications made by a client are lost when the file system is unmounted or when the client reboots. 3 Write operations from STNFS fail when the system memory falls below the predetermined threshold. This threshold is internal to STNFS and cannot be configured externally.

NFS 단기 파일 시스템 마운트(6.1)

mount 명령으로 NFS 파일 시스템을 단기로 마운트합니다. 예를 들어 다음 명령을 입력합니다.

text
mount -v stnfs -o options server:/remote-path /local-path

쓸 수 있는 옵션은 다음과 같습니다.

옵션 설명
vers=3 서버와 NFS 버전 3으로 통신합니다.
vers=4 서버와 NFS 버전 4로 통신합니다.
rsize=size 읽기 크기(바이트)를 설정합니다.
proto=udp NFS 서버와 UDP로 통신합니다.
proto=tcp NFS 서버와 TCP로 통신합니다.
hard NFS hard 마운트를 씁니다.
soft NFS soft 마운트를 씁니다.
sec 지정한 보안 분류를 씁니다.

기본 옵션은 vers=3 rsize=32768 proto=tcp hard sec=sys입니다.

영어 원문

Mounting a NFS short-term file system

The mount command is used to mount an NFS file system on a short-term basis. For example, type the following command:

text
mount -v stnfs -o options server:/remote-path /local-path

The available options are:

vers=3 Use NFS version 3 to communicate with the server.

vers=4 Use NFS version 4 to communicate with the server.

rsize=size

Set the read-size bytes.

proto=udp

Use UDP to communicate with the NFS server.

proto=tcp

Use TCP to communicate with the NFS server.

hard Use NFS hard mounts.

soft Use NFS soft mounts.

sec Use the specified security classification.

The default options are: vers=3 rsize=32768 proto=tcp hard sec=sys