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.
19 Running a development deployment
20 --------------------------------
21 Ceph contains a script called ``vstart.sh`` (see also :doc:`/dev/dev_cluster_deployement`) which allows developers to quickly test their code using
22 a simple deployment on your development system. Once the build finishes successfully, start the ceph
23 deployment using the following command:
27 $ cd ceph/build # Assuming this is where you ran cmake
29 $ ../src/vstart.sh -d -n -x
31 You can also configure ``vstart.sh`` to use only one monitor and one metadata server by using the following:
35 $ MON=1 MDS=1 ../src/vstart.sh -d -n -x
37 The system creates three pools on startup: `cephfs_data`, `cephfs_metadata`, and `rbd`. Let's get some stats on
42 $ bin/ceph osd pool stats
43 *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
50 pool cephfs_metadata id 2
53 $ bin/ceph osd pool stats cephfs_data
54 *** DEVELOPER MODE: setting PATH, PYTHONPATH and LD_LIBRARY_PATH ***
59 pool name category KB objects clones degraded unfound rd rd KB wr wr KB
60 rbd - 0 0 0 0 0 0 0 0 0
61 cephfs_data - 0 0 0 0 0 0 0 0 0
62 cephfs_metadata - 2 20 0 40 0 0 0 21 8
63 total used 12771536 20
64 total avail 3697045460
65 total space 3709816996
68 Make a pool and run some benchmarks against it:
72 $ bin/rados mkpool mypool
73 $ bin/rados -p mypool bench 10 write -b 123
75 Place a file into the new pool:
79 $ bin/rados -p mypool put objectone <somefile>
80 $ bin/rados -p mypool put objecttwo <anotherfile>
82 List the objects in the pool:
86 $ bin/rados -p mypool ls
88 Once you are done, type the following to stop the development ceph deployment:
94 Resetting your vstart environment
95 ---------------------------------
97 The vstart script creates out/ and dev/ directories which contain
98 the cluster's state. If you want to quickly reset your environment,
99 you might do something like this:
103 [build]$ ../src/stop.sh
104 [build]$ rm -rf out dev
105 [build]$ MDS=1 MON=1 OSD=3 ../src/vstart.sh -n -d
107 Running a RadosGW development environment
108 -----------------------------------------
110 Set the ``RGW`` environment variable when running vstart.sh to enable the RadosGW.
115 $ RGW=1 ../src/vstart.sh -d -n -x
117 You can now use the swift python client to communicate with the RadosGW.
121 $ swift -A http://localhost:8000/auth -U test:tester -K testing list
122 $ swift -A http://localhost:8000/auth -U test:tester -K testing upload mycontainer ceph
123 $ swift -A http://localhost:8000/auth -U test:tester -K testing list
129 The tests are located in `src/tests`. To run them type: