nfs-rdma.rst 9.0 KB

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