Building kernel client

From Ceph wiki

Jump to: navigation, search

Kernel version 2.6.34 already includes the Ceph kernel client.

Note that you need 2.6.27 or later. For kernel versions 2.6.32 and earlier refer first to Patching your kernel.

There are two git trees:

  • ceph-client.git contains the full kernel and the latest code, but will generally only build on very recent (or the latest) kernel.
  • ceph-client-standalone.git contains only the ceph module source, and includes branches with backport #ifdefs back through 2.6.27. It mirrors the code in main ceph-client.git, but may lag behind by a few days.

Generally speaking, you're better off with the -standalone.git source.

To get the code:

$ git clone git://ceph.newdream.net/git/ceph-client-standalone.git
$ git branch master-backport origin/master-backport

To build:

$ git checkout master-backport    # VERY IMPORTANT if you're not using the absolute latest mainline kernel 
$ make -C libceph                 # build against running kernel            
$ cp libceph/Module.symvers ceph/ 
$ make -C ceph
$ make KERNELDIR=/path/to/linux  -C libceph  # or against some other kernel
$ cp libceph/Module.symvers ceph/ 
$ make KERNELDIR=/path/to/linux -C ceph

To load the module:

$ insmod ./libceph/libceph.ko
$ insmod ./ceph/ceph.ko

or:

$ make modules_install
$ depmod
$ modprobe libceph
$ modprobe ceph

To mount, figure out what IP the monitor is running on, and then

$ mount -t ceph 1.2.3.4:/ /mnt/ceph

If mount.ceph is installed in /sbin, you can use a host name in place of an IP address.

The mount command supports a Round Robin DNS record, so if you create multiple DNS A records, your mount command will use all the IP's it returns as monitor addresses. Very useful for large clusters.

Personal tools