1 =================================
2 Developer Guide (Quick)
3 =================================
5 This guide will describe how to build and test Ceph for development.
10 The ``run-make-check.sh`` script will install Ceph dependencies,
11 compile everything in debug mode and run a number of tests to verify
12 the result behaves as expected.
18 Optionally if you want to work on a specific component of Ceph,
19 install the dependencies and build Ceph in debug mode with required cmake flags.
26 ./do_cmake.sh -DWITH_MANPAGE=OFF -DWITH_BABELTRACE=OFF -DWITH_MGR_DASHBOARD_FRONTEND=OFF
28 You can also turn off building of some core components that are not relevant to
33 ./do_cmake.sh ... -DWITH_RBD=OFF -DWITH_KRBD=OFF -DWITH_RADOSGW=OFF
39 cmake --build build [--target <target>...]
41 Omit ``--target...`` if you want to do a full build.
44 Running a development deployment
45 --------------------------------
47 Ceph contains a script called ``vstart.sh`` (see also
48 :doc:`/dev/dev_cluster_deployement`) which allows developers to quickly test
49 their code using a simple deployment on your development system. Once the build
50 finishes successfully, start the ceph deployment using the following command:
55 ../src/vstart.sh -d -n
57 You can also configure ``vstart.sh`` to use only one monitor and one metadata server by using the following:
61 env MON=1 MDS=1 ../src/vstart.sh -d -n -x
63 Most logs from the cluster can be found in ``build/out``.
65 The system creates two pools on startup: `cephfs_data_a` and `cephfs_metadata_a`. Let's get some stats on
68 .. code-block:: console
70 $ bin/ceph osd pool stats
71 *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
72 pool cephfs_data_a id 1
75 pool cephfs_metadata_a id 2
78 $ bin/ceph osd pool stats cephfs_data_a
79 *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
80 pool cephfs_data_a id 1
84 POOL_NAME USED OBJECTS CLONES COPIES MISSING_ON_PRIMARY UNFOUND DEGRADED RD_OPS RD WR_OPS WR
85 cephfs_data_a 0 0 0 0 0 0 0 0 0 0 0
86 cephfs_metadata_a 2246 21 0 63 0 0 0 0 0 42 8192
93 Make a pool and run some benchmarks against it:
97 bin/ceph osd pool create mypool
98 bin/rados -p mypool bench 10 write -b 123
100 Place a file into the new pool:
104 bin/rados -p mypool put objectone <somefile>
105 bin/rados -p mypool put objecttwo <anotherfile>
107 List the objects in the pool:
111 bin/rados -p mypool ls
113 Once you are done, type the following to stop the development ceph deployment:
119 Resetting your vstart environment
120 ---------------------------------
122 The vstart script creates out/ and dev/ directories which contain
123 the cluster's state. If you want to quickly reset your environment,
124 you might do something like this:
126 .. prompt:: bash [build]$
130 env MDS=1 MON=1 OSD=3 ../src/vstart.sh -n -d
132 Running a RadosGW development environment
133 -----------------------------------------
135 Set the ``RGW`` environment variable when running vstart.sh to enable the RadosGW.
140 RGW=1 ../src/vstart.sh -d -n -x
142 You can now use the swift python client to communicate with the RadosGW.
146 swift -A http://localhost:8000/auth -U test:tester -K testing list
147 swift -A http://localhost:8000/auth -U test:tester -K testing upload mycontainer ceph
148 swift -A http://localhost:8000/auth -U test:tester -K testing list
154 The tests are located in `src/tests`. To run them type:
158 (cd build && ninja check)