nfs-rdma.txt 8.5 KB

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