← Documents Documentation/admin-guide/nfs/nfs-rdma.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / NFS

Setting up NFS/RDMA

NFS/RDMA의 역사적 설치 절차, RDMA·NFS 사전 검증, server port와 client mount 구성을 설명하며 원문이 obsolete 가능성을 경고합니다.

Source pathDocumentation/admin-guide/nfs/nfs-rdma.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

운영 핵심

nfs-rdma.rst:1-292

이 2008년 문서는 NFS/RDMA client와 server를 kernel 2.6.25 계열 방식으로 구성합니다. 원문 경고대로 최신 환경에서는 현재 배포판 절차와 대조해야 합니다.

관점핵심
상태원문 자체가 probably obsolete라고 경고하는 2008년 절차
KernelNFS와 RDMA를 켜면 hidden `SUNRPC_XPRT_RDMA`가 build 방식을 결정
사전 검증RDMA stack과 표준 NFS over TCP/IP·UDP/IP를 먼저 시험
Server`/etc/exports`, `svcrdma`, `/proc/fs/nfsd/portlist` port 20049
Client`xprtrdma.ko`와 `mount -o rdma,port=20049`
검증`/proc/mounts`의 `proto` field 확인

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ===================
2 Setting up NFS/RDMA
3 ===================
4
5 :Author:
6 NetApp and Open Grid Computing (May 29, 2008)
7
8 .. warning::
9 This document is probably obsolete.
10
11 Overview
12 ========
13
14 This document describes how to install and setup the Linux NFS/RDMA client
15 and server software.
16
17 The NFS/RDMA client was first included in Linux 2.6.24. The NFS/RDMA server
18 was first included in the following release, Linux 2.6.25.
19
20 In our testing, we have obtained excellent performance results (full 10Gbit
21 wire bandwidth at minimal client CPU) under many workloads. The code passes
22 the full Connectathon test suite and operates over both Infiniband and iWARP
23 RDMA adapters.
24
25 Getting Help
26 ============
27
28 If you get stuck, you can ask questions on the
29 [email protected] mailing list.
30
31 Installation
32 ============
33
34 These instructions are a step by step guide to building a machine for
35 use with NFS/RDMA.
36
37 - Install an RDMA device
38
39 Any device supported by the drivers in drivers/infiniband/hw is acceptable.
40
41 Testing has been performed using several Mellanox-based IB cards, the
42 Ammasso AMS1100 iWARP adapter, and the Chelsio cxgb3 iWARP adapter.
43
44 - Install a Linux distribution and tools
45
46 The first kernel release to contain both the NFS/RDMA client and server was
47 Linux 2.6.25 Therefore, a distribution compatible with this and subsequent
48 Linux kernel release should be installed.
49
50 The procedures described in this document have been tested with
51 distributions from Red Hat's Fedora Project (http://fedora.redhat.com/).
52
53 - Install nfs-utils-1.1.2 or greater on the client
54
55 An NFS/RDMA mount point can be obtained by using the mount.nfs command in
56 nfs-utils-1.1.2 or greater (nfs-utils-1.1.1 was the first nfs-utils
57 version with support for NFS/RDMA mounts, but for various reasons we
58 recommend using nfs-utils-1.1.2 or greater). To see which version of
59 mount.nfs you are using, type:
60
61 .. code-block:: sh
62
63 $ /sbin/mount.nfs -V
64
65 If the version is less than 1.1.2 or the command does not exist,
66 you should install the latest version of nfs-utils.
67
68 Download the latest package from: https://www.kernel.org/pub/linux/utils/nfs
69
70 Uncompress the package and follow the installation instructions.
71
72 If you will not need the idmapper and gssd executables (you do not need
73 these to create an NFS/RDMA enabled mount command), the installation
74 process can be simplified by disabling these features when running
75 configure:
76
77 .. code-block:: sh
78
79 $ ./configure --disable-gss --disable-nfsv4
80
81 To build nfs-utils you will need the tcp_wrappers package installed. For
82 more information on this see the package's README and INSTALL files.
83
84 After building the nfs-utils package, there will be a mount.nfs binary in
85 the utils/mount directory. This binary can be used to initiate NFS v2, v3,
86 or v4 mounts. To initiate a v4 mount, the binary must be called
87 mount.nfs4. The standard technique is to create a symlink called
88 mount.nfs4 to mount.nfs.
89
90 This mount.nfs binary should be installed at /sbin/mount.nfs as follows:
91
92 .. code-block:: sh
93
94 $ sudo cp utils/mount/mount.nfs /sbin/mount.nfs
95
96 In this location, mount.nfs will be invoked automatically for NFS mounts
97 by the system mount command.
98
99 .. note::
100 mount.nfs and therefore nfs-utils-1.1.2 or greater is only needed
101 on the NFS client machine. You do not need this specific version of
102 nfs-utils on the server. Furthermore, only the mount.nfs command from
103 nfs-utils-1.1.2 is needed on the client.
104
105 - Install a Linux kernel with NFS/RDMA
106
107 The NFS/RDMA client and server are both included in the mainline Linux
108 kernel version 2.6.25 and later. This and other versions of the Linux
109 kernel can be found at: https://www.kernel.org/pub/linux/kernel/
110
111 Download the sources and place them in an appropriate location.
112
113 - Configure the RDMA stack
114
115 Make sure your kernel configuration has RDMA support enabled. Under
116 Device Drivers -> InfiniBand support, update the kernel configuration
117 to enable InfiniBand support [NOTE: the option name is misleading. Enabling
118 InfiniBand support is required for all RDMA devices (IB, iWARP, etc.)].
119
120 Enable the appropriate IB HCA support (mlx4, mthca, ehca, ipath, etc.) or
121 iWARP adapter support (amso, cxgb3, etc.).
122
123 If you are using InfiniBand, be sure to enable IP-over-InfiniBand support.
124
125 - Configure the NFS client and server
126
127 Your kernel configuration must also have NFS file system support and/or
128 NFS server support enabled. These and other NFS related configuration
129 options can be found under File Systems -> Network File Systems.
130
131 - Build, install, reboot
132
133 The NFS/RDMA code will be enabled automatically if NFS and RDMA
134 are turned on. The NFS/RDMA client and server are configured via the hidden
135 SUNRPC_XPRT_RDMA config option that depends on SUNRPC and INFINIBAND. The
136 value of SUNRPC_XPRT_RDMA will be:
137
138 #. N if either SUNRPC or INFINIBAND are N, in this case the NFS/RDMA client
139 and server will not be built
140
141 #. M if both SUNRPC and INFINIBAND are on (M or Y) and at least one is M,
142 in this case the NFS/RDMA client and server will be built as modules
143
144 #. Y if both SUNRPC and INFINIBAND are Y, in this case the NFS/RDMA client
145 and server will be built into the kernel
146
147 Therefore, if you have followed the steps above and turned no NFS and RDMA,
148 the NFS/RDMA client and server will be built.
149
150 Build a new kernel, install it, boot it.
151
152 Check RDMA and NFS Setup
153 ========================
154
155 Before configuring the NFS/RDMA software, it is a good idea to test
156 your new kernel to ensure that the kernel is working correctly.
157 In particular, it is a good idea to verify that the RDMA stack
158 is functioning as expected and standard NFS over TCP/IP and/or UDP/IP
159 is working properly.
160
161 - Check RDMA Setup
162
163 If you built the RDMA components as modules, load them at
164 this time. For example, if you are using a Mellanox Tavor/Sinai/Arbel
165 card:
166
167 .. code-block:: sh
168
169 $ modprobe ib_mthca
170 $ modprobe ib_ipoib
171
172 If you are using InfiniBand, make sure there is a Subnet Manager (SM)
173 running on the network. If your IB switch has an embedded SM, you can
174 use it. Otherwise, you will need to run an SM, such as OpenSM, on one
175 of your end nodes.
176
177 If an SM is running on your network, you should see the following:
178
179 .. code-block:: sh
180
181 $ cat /sys/class/infiniband/driverX/ports/1/state
182 4: ACTIVE
183
184 where driverX is mthca0, ipath5, ehca3, etc.
185
186 To further test the InfiniBand software stack, use IPoIB (this
187 assumes you have two IB hosts named host1 and host2):
188
189 .. code-block:: sh
190
191 host1$ ip link set dev ib0 up
192 host1$ ip address add dev ib0 a.b.c.x
193 host2$ ip link set dev ib0 up
194 host2$ ip address add dev ib0 a.b.c.y
195 host1$ ping a.b.c.y
196 host2$ ping a.b.c.x
197
198 For other device types, follow the appropriate procedures.
199
200 - Check NFS Setup
201
202 For the NFS components enabled above (client and/or server),
203 test their functionality over standard Ethernet using TCP/IP or UDP/IP.
204
205 NFS/RDMA Setup
206 ==============
207
208 We recommend that you use two machines, one to act as the client and
209 one to act as the server.
210
211 One time configuration:
212 -----------------------
213
214 - On the server system, configure the /etc/exports file and start the NFS/RDMA server.
215
216 Exports entries with the following formats have been tested::
217
218 /vol0 192.168.0.47(fsid=0,rw,async,insecure,no_root_squash)
219 /vol0 192.168.0.0/255.255.255.0(fsid=0,rw,async,insecure,no_root_squash)
220
221 The IP address(es) is(are) the client's IPoIB address for an InfiniBand
222 HCA or the client's iWARP address(es) for an RNIC.
223
224 .. note::
225 The "insecure" option must be used because the NFS/RDMA client does
226 not use a reserved port.
227
228 Each time a machine boots:
229 --------------------------
230
231 - Load and configure the RDMA drivers
232
233 For InfiniBand using a Mellanox adapter:
234
235 .. code-block:: sh
236
237 $ modprobe ib_mthca
238 $ modprobe ib_ipoib
239 $ ip li set dev ib0 up
240 $ ip addr add dev ib0 a.b.c.d
241
242 .. note::
243 Please use unique addresses for the client and server!
244
245 - Start the NFS server
246
247 If the NFS/RDMA server was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in
248 kernel config), load the RDMA transport module:
249
250 .. code-block:: sh
251
252 $ modprobe svcrdma
253
254 Regardless of how the server was built (module or built-in), start the
255 server:
256
257 .. code-block:: sh
258
259 $ /etc/init.d/nfs start
260
261 or
262
263 .. code-block:: sh
264
265 $ service nfs start
266
267 Instruct the server to listen on the RDMA transport:
268
269 .. code-block:: sh
270
271 $ echo rdma 20049 > /proc/fs/nfsd/portlist
272
273 - On the client system
274
275 If the NFS/RDMA client was built as a module (CONFIG_SUNRPC_XPRT_RDMA=m in
276 kernel config), load the RDMA client module:
277
278 .. code-block:: sh
279
280 $ modprobe xprtrdma.ko
281
282 Regardless of how the client was built (module or built-in), use this
283 command to mount the NFS/RDMA server:
284
285 .. code-block:: sh
286
287 $ mount -o rdma,port=20049 <IPoIB-server-name-or-address>:/<export> /mnt
288
289 To verify that the mount is using RDMA, run "cat /proc/mounts" and check
290 the "proto" field for the given mount.
291
292 Congratulations! You're using NFS/RDMA!
293

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

문서 정보와 경고

1-10

제목은 `Setting up NFS/RDMA`이며 NetApp과 Open Grid Computing이 2008년 5월 29일 작성했습니다.

원문은 이 문서가 probably obsolete라고 명시합니다. 현재 system에 적용하기 전에 배포판과 최신 kernel·nfs-utils 문서를 반드시 대조하십시오.

개요와 도움 요청

11-30

이 문서는 Linux NFS/RDMA client와 server software의 설치·설정 절차를 설명합니다. Client는 Linux 2.6.24에 처음 포함됐고 server는 다음 release인 Linux 2.6.25에 포함됐습니다.

원문 시험에서는 여러 workload에서 최소 client CPU로 full 10Gbit wire bandwidth를 얻었고, code가 전체 Connectathon test suite를 통과하며 Infiniband와 iWARP RDMA adapter에서 모두 동작했습니다.

문제가 생기면 `[email protected]` mailing list에 질문할 수 있습니다.

장치·배포판·nfs-utils 설치

31-104

NFS/RDMA machine 준비 조건은 다음과 같습니다.

구성요구 사항원문 확인 범위
RDMA device`drivers/infiniband/hw`의 driver가 지원하는 장치Mellanox IB, Ammasso AMS1100 iWARP, Chelsio cxgb3 iWARP에서 시험
Linux distributionLinux 2.6.25 이상과 호환Client와 server가 모두 mainline에 들어간 최초 release 기준
Client utility`nfs-utils-1.1.2` 이상`mount.nfs`로 NFS/RDMA mount를 생성하며 server에는 이 특정 version이 필요하지 않음

사용 중인 `mount.nfs` version을 다음 명령으로 확인합니다.

$ /sbin/mount.nfs -V

`nfs-utils-1.1.1`은 NFS/RDMA mount를 처음 지원한 nfs-utils version이지만, 원문은 여러 이유로 `nfs-utils-1.1.2` 이상을 권장합니다. 사용 중인 version이 1.1.2보다 낮거나 명령이 없으면 최신 nfs-utils를 설치합니다. `idmapper`와 `gssd` executable이 필요 없다면 NFS/RDMA mount command 자체에는 필요하지 않으므로 configure 때 기능을 끌 수 있습니다.

$ ./configure --disable-gss --disable-nfsv4

nfs-utils build에는 `tcp_wrappers` package가 필요하며 자세한 내용은 package의 `README`와 `INSTALL`을 봅니다. Build 뒤 `utils/mount`의 `mount.nfs`는 NFS v2·v3·v4 mount를 시작할 수 있습니다. V4는 binary 이름이 `mount.nfs4`여야 하므로 보통 `mount.nfs4`에서 `mount.nfs`로 symlink를 만듭니다.

완성한 binary를 다음처럼 `/sbin/mount.nfs`에 설치합니다.

$ sudo cp utils/mount/mount.nfs /sbin/mount.nfs

이 위치에 있으면 system `mount` command가 NFS mount 때 `mount.nfs`를 자동 호출합니다.

`mount.nfs`, 즉 nfs-utils-1.1.2 이상은 NFS client machine에만 필요합니다. Server에는 이 특정 version이 필요 없고 client도 nfs-utils 전체가 아니라 해당 `mount.nfs` command만 필요합니다.

Kernel과 RDMA·NFS 구성

105-151

NFS/RDMA client와 server는 mainline Linux 2.6.25 이상에 함께 포함됩니다. Kernel source는 다음 위치에서 받을 수 있습니다.

Kernel configuration에서 `Device Drivers -> InfiniBand support`의 RDMA 지원을 켭니다. 이름과 달리 이 option은 IB와 iWARP를 포함한 모든 RDMA device에 필요합니다. 사용하는 IB HCA의 `mlx4`, `mthca`, `ehca`, `ipath` 또는 iWARP adapter의 `amso`, `cxgb3` 지원을 켭니다. InfiniBand를 쓴다면 IP-over-InfiniBand도 활성화합니다.

`File Systems -> Network File Systems`에서 NFS filesystem support와 필요하면 NFS server support를 켭니다. NFS와 RDMA가 활성화되면 NFS/RDMA code도 자동 활성화됩니다.

Client와 server build 방식은 `SUNRPC`와 `INFINIBAND`에 의존하는 hidden `SUNRPC_XPRT_RDMA` config option으로 결정됩니다.

결과조건Build 동작
N`SUNRPC=N` 또는 `INFINIBAND=N`NFS/RDMA client와 server를 build하지 않음
M두 symbol이 M 또는 Y이고 하나 이상이 MClient와 server를 module로 build
Y`SUNRPC=Y` 및 `INFINIBAND=Y`Client와 server를 kernel built-in으로 build

따라서 위 절차대로 NFS와 RDMA를 모두 켜면 client와 server가 build됩니다. 새 kernel을 build·install하고 reboot합니다.

RDMA와 일반 NFS 사전 검사

152-204

NFS/RDMA software를 구성하기 전에 새 kernel, RDMA stack, 표준 NFS over TCP/IP 또는 UDP/IP가 정상 동작하는지 확인하는 것이 좋습니다.

대상검사
RDMADriver load, Subnet Manager, port state `4: ACTIVE`, IPoIB ping
NFS일반 Ethernet에서 TCP/IP 또는 UDP/IP로 client/server 기능 확인

RDMA component를 module로 build했다면 load합니다. Mellanox Tavor/Sinai/Arbel card 예시는 다음과 같습니다.

$ modprobe ib_mthca
$ modprobe ib_ipoib

InfiniBand network에는 Subnet Manager(SM)가 필요합니다. IB switch의 embedded SM을 쓰거나 end node 하나에서 OpenSM 같은 SM을 실행합니다. SM이 동작하면 port state는 다음과 같이 보여야 합니다.

$ cat /sys/class/infiniband/driverX/ports/1/state
4: ACTIVE

`driverX`는 `mthca0`, `ipath5`, `ehca3` 등입니다. Host 이름이 `host1`, `host2`인 두 IB system에서 IPoIB stack을 더 시험하는 절차는 다음과 같습니다.

host1$ ip link set dev ib0 up
host1$ ip address add dev ib0 a.b.c.x
host2$ ip link set dev ib0 up
host2$ ip address add dev ib0 a.b.c.y
host1$ ping a.b.c.y
host2$ ping a.b.c.x

다른 device type은 해당 절차를 따릅니다. 활성화한 NFS client/server는 일반 Ethernet에서 TCP/IP 또는 UDP/IP로 기능을 시험합니다.

Server 일회성 구성

205-227

Client와 server 역할을 각각 맡는 두 machine 사용을 권장합니다. Server의 `/etc/exports`를 구성하고 NFS/RDMA server를 시작합니다. 원문에서 시험한 export 형식은 다음과 같습니다.

/vol0   192.168.0.47(fsid=0,rw,async,insecure,no_root_squash)
/vol0   192.168.0.0/255.255.255.0(fsid=0,rw,async,insecure,no_root_squash)

IP address는 InfiniBand HCA를 쓸 때 client의 IPoIB address이고, RNIC를 쓸 때 client의 iWARP address입니다.

NFS/RDMA client는 reserved port를 사용하지 않으므로 export에 `insecure` option을 반드시 사용해야 합니다.

매 boot의 server·client 절차

228-292

Mellanox adapter 기반 InfiniBand에서는 RDMA driver를 load하고 `ib0`를 올린 뒤 client와 server에 서로 다른 address를 설정합니다.

$ modprobe ib_mthca
$ modprobe ib_ipoib
$ ip li set dev ib0 up
$ ip addr add dev ib0 a.b.c.d

Client와 server에는 반드시 unique address를 사용하십시오.

NFS/RDMA server가 `CONFIG_SUNRPC_XPRT_RDMA=m` module로 build됐다면 RDMA transport module을 load합니다.

$ modprobe svcrdma

Module 또는 built-in 여부와 관계없이 NFS server를 시작합니다.

$ /etc/init.d/nfs start

또는 service command를 사용할 수 있습니다.

$ service nfs start

Server가 RDMA transport의 port `20049`에서 listen하도록 지시합니다.

$ echo rdma 20049 > /proc/fs/nfsd/portlist

Client가 `CONFIG_SUNRPC_XPRT_RDMA=m` module로 build됐다면 RDMA client module을 load합니다.

$ modprobe xprtrdma.ko

Client의 build 방식과 관계없이 다음 명령으로 NFS/RDMA server를 mount합니다.

$ mount -o rdma,port=20049 <IPoIB-server-name-or-address>:/<export> /mnt

RDMA mount인지 검증하려면 `cat /proc/mounts`를 실행하고 해당 mount의 `proto` field를 확인합니다.