# A client for the Ceph filesystem

### Introduction

This page describes how to use Ceph as a backing store with Hadoop. This page assumes that you have downloaded the Ceph software and installed necessary binaries as outlined in the Ceph documentation.

### Steps

- In the Hadoop conf directory edit core-site.xml, adding the following (with appropriate substitutions). Note that different nodes can connect to different monitors in the same cluster without issue (the Ceph client will automatically redirect as necessary).

      <property>
        <name>fs.default.name</name>
        <value>ceph://null</value>
      </property>

      <property>
        <name>fs.ceph.monAddr</name>
        <value><serverIP:port></value>
        <description>The location of the Ceph monitor to connect to.
        This should be an IP address, not a domain-based web address.</description>
      </property>

      <property>
        <name>fs.ceph.libDir</name>
        <value>/usr/local/lib</value>
        <description>The folder holding libcephfs and libhadoopceph</description>
        </property>

- There are also a number of optional Ceph configuration options.

      <property>
        <name>fs.ceph.blockSize</name>
        <value>67108864</value>
        <description>Defaulting to 64MB, this is the size (in bytes) you want Ceph to use in striping data internally and presenting it to Hadoop.</description>
      </property>

      <property>
        <name>fs.ceph.debug</name>
        <value>true</value>
        <description>If true, the Java-based code will print debugging information to standard error. This is useful if attempting to debug a Ceph issue as it puts both outputs in the same place.</description>
      </property>

      <property>
        <name>fs.ceph.clientDebug</name>
        <value>1</value>
        <description>If non-zero, the Ceph client will print debugging information to standard error (a higher number=more debugging).</description>
      </property>

      <property>
        <name>fs.ceph.messengerDebug</name>
        <value>1</value>
        <description>If non-zero, the Ceph messenger will print debugging information to standard error(a higher number=more debugging)</description>
      </property>

      <property>
        <name>fs.ceph.readahead</name>
        <value>1</value>
        <description>Sets the number of object periods to read ahead in prefetching. This should probably be left at the default of 1.</description>
      </property>

      <property>
        <name>fs.ceph.commandLine</name>
        <value>a string</value>
        <description>If you prefer, you may enter any of Ceph's command-line configuration here and it will get passed to the C client. Note that any filled-in configuration options will override what you put here.

      By default, Ceph performs writes across the network rather than locally. To force local writes, add "set_local_pg" in this property.</description>
      </property>

- Start up your Ceph instance according to the Ceph documentation.
- Do not use the bin/start-all.sh commands, as they will attempt to start up an hdfs instance. Just start whatever systems you need and they will automatically make use of the Ceph filesystem once configured as above.