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 Running a development deployment
29 --------------------------------
30 Ceph contains a script called ``vstart.sh`` (see also :doc:`/dev/dev_cluster_deployement`) which allows developers to quickly test their code using
31 a simple deployment on your development system. Once the build finishes successfully, start the ceph
32 deployment using the following command:
36 cd ceph/build # Assuming this is where you ran cmake
38 ../src/vstart.sh -d -n -x
40 You can also configure ``vstart.sh`` to use only one monitor and one metadata server by using the following:
44 MON=1 MDS=1 ../src/vstart.sh -d -n -x
46 The system creates two pools on startup: `cephfs_data_a` and `cephfs_metadata_a`. Let's get some stats on
49 .. code-block:: console
51 $ bin/ceph osd pool stats
52 *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
53 pool cephfs_data_a id 1
56 pool cephfs_metadata_a id 2
59 $ bin/ceph osd pool stats cephfs_data_a
60 *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
61 pool cephfs_data_a id 1
65 POOL_NAME USED OBJECTS CLONES COPIES MISSING_ON_PRIMARY UNFOUND DEGRADED RD_OPS RD WR_OPS WR
66 cephfs_data_a 0 0 0 0 0 0 0 0 0 0 0
67 cephfs_metadata_a 2246 21 0 63 0 0 0 0 0 42 8192
74 Make a pool and run some benchmarks against it:
78 bin/ceph osd pool create mypool
79 bin/rados -p mypool bench 10 write -b 123
81 Place a file into the new pool:
85 bin/rados -p mypool put objectone <somefile>
86 bin/rados -p mypool put objecttwo <anotherfile>
88 List the objects in the pool:
92 bin/rados -p mypool ls
94 Once you are done, type the following to stop the development ceph deployment:
100 Resetting your vstart environment
101 ---------------------------------
103 The vstart script creates out/ and dev/ directories which contain
104 the cluster's state. If you want to quickly reset your environment,
105 you might do something like this:
107 .. prompt:: bash [build]$
111 MDS=1 MON=1 OSD=3 ../src/vstart.sh -n -d
113 Running a RadosGW development environment
114 -----------------------------------------
116 Set the ``RGW`` environment variable when running vstart.sh to enable the RadosGW.
121 RGW=1 ../src/vstart.sh -d -n -x
123 You can now use the swift python client to communicate with the RadosGW.
127 swift -A http://localhost:8000/auth -U test:tester -K testing list
128 swift -A http://localhost:8000/auth -U test:tester -K testing upload mycontainer ceph
129 swift -A http://localhost:8000/auth -U test:tester -K testing list
135 The tests are located in `src/tests`. To run them type: