C H A P T E R  29

Installing Lustre from Source Code

If you need to build a customized Lustre server kernel or are using a Linux kernel that has not been tested with the version of Lustre you are installing, you may need to build and install Lustre from source code. This chapter describes:


29.1 Overview and Prerequisites

Lustre can be installed from either pre-built binary packages (RPMs) or freely-available source code. Installing from the package release is recommended unless you need to customize the Lustre server kernel or will be using an Linux kernel that has not been tested with Lustre. For a list of supported Linux distributions and architectures, see the topic Lustre_2.0 on the Lustre wiki. The procedure for installing Lustre from RPMs is describe in Chapter 8: Installing the Lustre Software.

To install Lustre from source code, the following are required:

The installation procedure involves several steps:


Note - When using third-party network hardware with Lustre, the third-party modules (typically, the drivers) must be linked against the Linux kernel. The LNET modules in Lustre also need these references. To meet these requirements, a specific process must be followed to install and recompile Lustre. See Installing Lustre with a Third-Party Network Stack, for an example showing how to install Lustre 1.6.6 using the Myricom MX 1.2.7 driver. The same process can be used for other third-party network stacks.


29.2 Patching the Kernel

If you are using non-standard hardware, plan to apply a Lustre patch, or have another reason not to use packaged Lustre binaries, you have to apply several Lustre patches to the core kernel and run the Lustre configure script against the kernel.

29.2.1 Introducing the Quilt Utility

To simplify the process of applying Lustre patches to the kernel, we recommend that you use the Quilt utility.

Quilt manages a stack of patches on a single source tree. A series file lists the patch files and the order in which they are applied. Patches are applied, incrementally, on the base tree and all preceding patches. You can:

A variety of Quilt packages (RPMs, SRPMs and tarballs) are available from various sources. Use the most recent version you can find. Quilt depends on several other utilities, e.g., the coreutils RPM that is only available in RedHat 9. For other RedHat kernels, you have to get the required packages to successfully install Quilt. If you cannot locate a Quilt package or fulfill its dependencies, you can build Quilt from a tarball, available at the Quilt project website:

http://savannah.nongnu.org/projects/quilt

For additional information on using Quilt, including its commands, see Introduction to Quilt and the quilt(1) man page.

29.2.2 Get the Lustre Source and Unpatched Kernel

The Lustre Engineering Team has targeted several Linux kernels for use with Lustre servers (MDS/OSS) and provides a series of patches for each one. The Lustre patches are maintained in the kernel_patch directory bundled with the Lustre source code.


caution icon Caution - Lustre contains kernel modifications which interact with storage devices and may introduce security issues and data loss if not installed, configured and administered correctly. Before installing Lustre, be cautious and back up ALL data.



Note - Each patch series has been tailored to a specific kernel version, and may or may not apply cleanly to other versions of the kernel.

To obtain the Lustre source and unpatched kernel:

1. Verify that all of the Lustre installation requirements have been met.

For more information on these prerequisites, see:

2. Download the Lustre source code.

On the Lustre download site, select a version of Lustre to download and then select “Source” as the platform.

3. Download the unpatched kernel.

For convenience, Oracle maintains an archive of unpatched kernel sources at:

http://downloads.lustre.org/public/kernels/

29.2.3 Patch the Kernel

This procedure describes how to use Quilt to apply the Lustre patches to the kernel. To illustrate the steps in this procedure, a RHEL 5 kernel is patched for Lustre 1.6.5.1.

1. Unpack the Lustre source and kernel to separate source trees.

a. Unpack the Lustre source.

For this procedure, we assume that the resulting source tree is in /tmp/lustre-1.6.5.1

b. Unpack the kernel.

For this procedure, we assume that the resulting source tree (also known as the destination tree) is in /tmp/kernels/linux-2.6.18

2. Select a config file for your kernel, located in the kernel_configs directory (lustre/kernel_patches/kernel_config).

The kernel_config directory contains the .config files, which are named to indicate the kernel and architecture with which they are associated. For example, the configuration file for the 2.6.18 kernel shipped with RHEL 5 (suitable for i686 SMP systems) is kernel-2.6.18-2.6-rhel5-i686-smp.config.

3. Select the series file for your kernel, located in the series directory (lustre/kernel_patches/series).

The series file contains the patches that need to be applied to the kernel.

4. Set up the necessary symlinks between the kernel patches and the Lustre source.

This example assumes that the Lustre source files are unpacked under /tmp/lustre-1.6.5.1 and you have chosen the 2.6-rhel5.series file). Run:

$ cd /tmp/kernels/linux-2.6.18
$ rm -f patches series
$ ln -s /tmp/lustre-1.6.5.1/lustre/kernel_patches/series/2.6-\ rhel5.series ./series
$ ln -s /tmp/lustre-1.6.5.1/lustre/kernel_patches/patches .

5. Use Quilt to apply the patches in the selected series file to the unpatched kernel. Run:

$ cd /tmp/kernels/linux-2.6.18
$ quilt push -av

The patched destination tree acts as a base Linux source tree for Lustre.


29.3 Creating and Installing the Lustre Packages

After patching the kernel, configure it to work with Lustre, create the Lustre packages (RPMs) and install them.

1. Configure the patched kernel to run with Lustre. Run:

$ cd <path to kernel tree>
$ cp /boot/config-‘uname -r‘ .config
$ make oldconfig || make menuconfig
$ make include/asm
$ make include/linux/version.h
$ make SUBDIRS=scripts
$ make include/linux/utsrelease.h

2. Run the Lustre configure script against the patched kernel and create the Lustre packages.

$ cd <path to lustre source tree>
$ ./configure --with-linux=<path to kernel tree>
$ make rpms

This creates a set of .rpms in /usr/src/redhat/RPMS/<arch> with an appended date-stamp. The SuSE path is /usr/src/packages.


Note - You do not need to run the Lustre configure script against an unpatched kernel.

Example set of RPMs:

lustre-1.6.5.1-\2.6.18_53.xx.xx.el5_lustre.1.6.5.1.custom_20081021.i686.rpm
 
lustre-debuginfo-1.6.5.1-\2.6.18_53.xx.xx.el5_lustre.1.6.5.1.custom_20081021.i686.rpm
 
lustre-modules-1.6.5.1-\2.6.18_53.xx.xxel5_lustre.1.6.5.1.custom_20081021.i686.rpm
 
lustre-source-1.6.5.1-\2.6.18_53.xx.xx.el5_lustre.1.6.5.1.custom_20081021.i686.rpm

Note - If the steps to create the RPMs fail, contact Lustre Support by reporting a bug. See Reporting a Lustre Bug.



Note - Several features and packages are available that extend the core functionality of Lustre. These features/packages can be enabled at the build time by issuing appropriate arguments to the configure command. For a list of these features and packages, run ./configure -help in the Lustre source tree. The configs/ directory of the kernel source contains the config files matching each the kernel version. Copy one to .config at the root of the kernel tree.

3. Create the kernel package. Navigate to the kernel source directory and run:

$ make rpm

Example result:

kernel-2.6.95.0.3.EL_lustre.1.6.5.1custom-1.i686.rpm

Note - Step 3 is only valid for RedHat and SuSE kernels. If you are using a stock Linux kernel, you need to get a script to create the kernel RPM.


4. Install the Lustre packages.

Some Lustre packages are installed on servers (MDS and OSSs), and others are installed on Lustre clients. For guidance on where to install specific packages, see TABLE 8-1 in Preparing to Install the Lustre Software. which lists required packages and for each package, where to install it. Depending on the selected platform, not all of the packages listed in TABLE 8-1 need to be installed.


Note - Running the patched server kernel on the clients is optional. It is not necessary unless the clients will be used for multiple purposes, for example, to run as a client and an OST.


Lustre packages should be installed in this order:

a. Install the kernel, modules and ldiskfs packages.

Navigate to the directory where the RPMs are stored, and use the rpm -ivh command to install the kernel, module and ldiskfs packages.

$ rpm -ivh kernel-lustre-smp-<ver> \
kernel-ib-<ver> \
lustre-modules-<ver> \
lustre-ldiskfs-<ver>

b. Install the utilities/userspace packages.

Use the rpm -ivh command to install the utilities packages. For example:

$ rpm -ivh lustre-<ver>

c. Install the e2fsprogs package.

Make sure the e2fsprogs package is unpacked, and use the rpm -i command to install it. For example:

$ rpm -i e2fsprogs-<ver>

d. (Optional) If you want to add optional packages to your Lustre system, install them now.

5. Verify that the boot loader (grub.conf or lilo.conf) has been updated to load the patched kernel.

6. Reboot the patched clients and the servers.

a. If you applied the patched kernel to any clients, reboot them.

Unpatched clients do not need to be rebooted.

b. Reboot the servers.

Once all the machines have rebooted, the next steps are to configure Lustre Networking (LNET) and the Lustre file system. See Chapter 10: Configuring Lustre.


29.4 Installing Lustre with a Third-Party Network Stack

When using third-party network hardware, you must follow a specific process to install and recompile Lustre. This section provides an installation example, describing how to install Lustre 1.6.6 while using the Myricom MX 1.2.7 driver. The same process is used for other third-party network stacks, by replacing MX-specific references in Step 2 with the stack-specific build and using the proper --with option when configuring the Lustre source code.

1. Compile and install the Lustre kernel.

a. Install the necessary build tools.

GCC and related tools must be installed. For more information, see Required Software.

$ yum install rpm-build redhat-rpm-config
$ mkdir -p rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
$ echo '%_topdir %(echo $HOME)/rpmbuild' > .rpmmacros

b. Install the patched Lustre source code.

This RPM is available at the Lustre download site.

$ rpm -ivh \
kernel-lustre-source-2.6.18-92.1.10.el5_lustre.1.6.6.x86_64.rpm

a. Build the Linux kernel RPM.

$ cd /usr/src/linux-2.6.18-92.1.10.el5_lustre.1.6.6
$ make distclean
$ make oldconfig dep bzImage modules
$ cp /boot/config-`uname -r` .config
$ make oldconfig || make menuconfig
$ make include/asm
$ make include/linux/version.h
$ make SUBDIRS=scripts
$ make rpm

b. Install the Linux kernel RPM.

If you are building a set of RPMs for a cluster installation, this step is not necessary. Source RPMs are only needed on the build machine.

$ rpm -ivh \
~/rpmbuild/kernel-lustre-2.6.18-92.1.10.el5_\lustre.1.6.6.x86_64.rpm
$ mkinitrd /boot/2.6.18-92.1.10.el5_lustre.1.6.6

c. Update the boot loader (/etc/grub.conf) with the new kernel boot information.

$ /sbin/shutdown 0 -r

2. Compile and install the MX stack.

$ cd /usr/src/
$ gunzip mx_1.2.7.tar.gz (can be obtained from www.myri.com/scs/)
$ tar -xvf mx_1.2.7.tar
$ cd mx-1.2.7
$ ln -s common include
$ ./configure --with-kernel-lib
$ make
$ make install

3. Compile and install the Lustre source code.

a. Install the Lustre source (this can be done via RPM or tarball). The source file is available at the Lustre download site. This example shows installation via the tarball.

$ cd /usr/src/
$ gunzip lustre-1.6.6.tar.gz
$ tar -xvf lustre-1.6.6.tar

b. Configure and build the Lustre source code.

The ./configure --help command shows a list of all of the --with options. All third-party network stacks are built in this manner.

$ cd lustre-1.6.6
$ ./configure --with-linux=/usr/src/linux \
--with-mx=/usr/src/mx-1.2.7
$ make
$ make rpms

The make rpms command output shows the location of the generated RPMs

4. Use the rpm -ivh command to install the RPMS.

$ rpm -ivh \
lustre-1.6.6-2.6.18_92.1.10.el5_lustre.1.6.6smp.x86_64.rpm
$ rpm -ivh \
lustre-modules-1.6.6-2.6.18_92.1.10.el5_lustre.1.6.6\
smp.x86_64.rpm
$ rpm -ivh \
lustre-ldiskfs-3.0.6-2.6.18_92.1.10.el5_lustre.1.6.6\
smp.x86_64.rpm

5. Add the following lines to the /etc/modprobe.conf file.

options kmxlnd hosts=/etc/hosts.mxlnd
options lnet networks=mx0(myri0),tcp0(eth0)

6. Populate the myri0 configuration with the proper IP addresses.

vim /etc/sysconfig/network-scripts/myri0

7. Add the following line to the /etc/hosts.mxlnd file.

$ IP HOST BOARD EP_ID

8. Start Lustre.

Once all the machines have rebooted, the next steps are to configure Lustre Networking (LNET) and the Lustre file system. See Chapter 10: Installing Lustre from Source Code.