|
In ConclusionOne of the distinguishing characteristics of a Linux Enterprise Cluster is that it is built using packet routing and manipulation techniques. As I'll describe in Part III, Linux machines become cluster load balancers or cluster nodes because they have special techniques for handling packets. In this chapter I've provided you with a brief overview of the foundation you need for understanding the sophisticated cluster packet-handling techniques that will be introduced in Part III.
|
|
Chapter 3: Compiling the Kernel
Overview
In this chapter I'll describe how to compile a Linux kernel. For many system administrators not familiar with Linux, this may sound like a risky thing to do on a server that will be used in production, but once you have done it a few times you'll understand one of the reasons why Linux is so powerful: you have complete control over the operating system. I could say a lot more about the benefits of having the source code of your operating system, but we'll save that for later. For now, we'll focus on what you need to be able to put your own Linux kernel into production. To install a Linux kernel you need to do five things:
|
|
What You Will NeedBefore you compile the kernel, you'll need to install the gcc compiler and its dependencies. (This software is not included with this book because your distribution should already contain it.) Here is a list of packages that are required to compile the kernel (this list is taken from the Red Hat distribution):
If you use a text-based terminal, you will also
need to have the ncurses package installed so that the
make
Once you've installed these packages, you're ready to begin. (If you have dependency problems when installing these package, see Appendix D for some tips.)
[1] Each kernel release should only be compiled with the version of gcc specified in the README file.
|
|
Step 1: Get the Source CodeYou'll have to decide whether to use the "stock" version of the Linux source code or the kernel source code included with your distribution. Here are a few of the pros and cons of each method.
Using the Stock KernelPros of using the stock kernel:
Con of using the stock kernel: It may invalidate support from your distribution vendor.
Using the Kernel Supplied with Your DistributionPros of using the distribution kernel:
Cons of using the distribution kernel:
Decide Which Kernel Version to UseIf you use the kernel source code supplied by your vendor, you won't have many decisions to make when it comes to picking a kernel version to use; your distribution vendor will do that for you. However, if you decide to use the stock version of the kernel, you'll have to do a little more research to determine which kernel version to use. You can use the following command to see which kernel version you are currently running:
#
Here are sample commands to copy the kernel source code from the CD-ROM included with this book onto your system's hard drive:
#mount /mnt/cdrom #cd /mnt/
Now you need to create a symbolic link so that your kernel source code will appear to be in the /usr/src/linux directory. But first you must remove the existing symbolic link. The commands to complete this step look like this:
#rm /usr/src/linux #ln -s /usr/src/linux-<version> /usr/src/linux #cd /usr/src/linux
You should now have your shell's current working directory set to the top level directory of the kernel source tree, and you're ready to go on to the next step.
[2] For example, you can apply the hidden loopback interface kernel patch that we'll use to build the real servers inside the cluster in Part III of this book.
|