From: Luis Pabón Date: Tue, 5 Aug 2014 18:48:38 +0000 (-0400) Subject: Developer quick start guide X-Git-Tag: v0.85~92^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=52cf693e8ded911a0ca7c3c2f2891a019c1ea5a8;p=ceph.git Developer quick start guide Signed-off-by: Luis Pabón --- diff --git a/README b/README index e947add40d20..76aeb4e62008 100644 --- a/README +++ b/README @@ -23,10 +23,31 @@ We do not require assignment of copyright to contribute code; code is contributed under the terms of the applicable license. +Build Prerequisites +=================== + +debian-based +------------ + +The list of debian package dependencies can be found in deps.deb.txt: + + sudo apt-get install `cat deps.deb.txt` + +Note: libsnappy-dev and libleveldb-dev are not available upstream for natty, oneiric, and squeeze. Backports for Ceph can be found at ceph.com/debian-leveldb. + +rpm-based +--------- + +The list of RPM package dependencies can be found in deps.rpm.txt: + + sudo yum install `cat deps.rpm.txt` + Building Ceph ============= -To build the server daemons, and FUSE client, execute the following: +Developers, please refer to the [Developer Guide](doc/dev/quick_guide.rst) +for more information, otherwise, you can build the server daemons, and FUSE client, +by executing the following: ./autogen.sh ./configure @@ -62,27 +83,6 @@ For RPM-based systems (Red Hat, SUSE, etc.), rpmbuild - -Build Prerequisites -=================== - -debian-based ------------- - -The list of debian package dependencies can be found in deps.deb.txt: - - sudo apt-get install `cat deps.deb.txt` - -Note: libsnappy-dev and libleveldb-dev are not available upstream for natty, oneiric, and squeeze. Backports for Ceph can be found at ceph.com/debian-leveldb. - -rpm-based ---------- - -The list of RPM package dependencies can be found in deps.rpm.txt: - - sudo yum install `cat deps.rpm.txt` - - Building the Documentation ========================== diff --git a/doc/dev/quick_guide.rst b/doc/dev/quick_guide.rst new file mode 100644 index 000000000000..976dda7731f0 --- /dev/null +++ b/doc/dev/quick_guide.rst @@ -0,0 +1,104 @@ +================================= + Developer Guide (Quick) +================================= + +This guide will describe how to build and test Ceph for development. + +Development +----------- + +After installing the dependencies described in the ``README``, +prepare the git source tree by updating the submodules + +.. code:: + + git submodule update --init + +To build the server daemons, and FUSE client, execute the following: + +.. code:: + + ./do_autogen.sh -d 1 + make -j [number of cpus] + +Running a development deployment +-------------------------------- +Ceph contains a script called ``vstart.sh`` which allows developers to quickly test their code using +a simple deployment on your development system. Once the build finishes successfully, start the ceph +deployment using the following command: + +.. code:: + + $ cd src + $ ./vstart.sh -d -n -x + +You can also configure ``vstart.sh`` to use only one monitor and one metadata server by using the following: + +.. code:: + + $ MON=1 MDS=1 ./vstart.sh -d -n -x + +The system creates three pools on startup: `data`, `metadata`, and `rbd`. Let's get some stats on +the current pools: + +.. code:: + + $ ./ceph osd pool stats + *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH *** + pool data id 0 + nothing is going on + + pool metadata id 1 + nothing is going on + + pool rbd id 2 + nothing is going on + + $ ./ceph osd pool stats data + *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH *** + pool data id 0 + nothing is going on + + $ ./rados df + pool name category KB objects clones degraded unfound rd rd KB wr wr KB + data - 0 0 0 0 0 0 0 0 0 + metadata - 2 20 0 40 0 0 0 21 8 + rbd - 0 0 0 0 0 0 0 0 0 + total used 12771536 20 + total avail 3697045460 + total space 3709816996 + + +Make a pool and run some benchmarks against it: + +.. code:: + + $ ./rados mkpool mypool + $ ./rados -p mypool bench 10 write -b 123 + +Place a file into the new pool: + +.. code:: + + $ ./rados -p mypool put objectone + $ ./rados -p mypool put objecttwo + +List the objects in the pool: + +.. code:: + + $ ./rados -p mypool ls + +Once you are done, type the following to stop the development ceph deployment: + +.. code:: + + $ ./stop.sh + +Run unit tests +-------------- + +The tests are located in `src/tests`. To run them type: + + $ make check + diff --git a/doc/index.rst b/doc/index.rst index c375b8e4f30e..565f481f06cd 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -93,6 +93,7 @@ about Ceph, see our `Architecture`_ section. start/intro start/index install/index + dev/quick_guide rados/index cephfs/index rbd/rbd