]> git.proxmox.com Git - ceph.git/blame - ceph/README.md
bump version to 12.2.10-pve1
[ceph.git] / ceph / README.md
CommitLineData
7c673cae
FG
1# Ceph - a scalable distributed storage system
2
3Please see http://ceph.com/ for current info.
4
5
6## Contributing Code
7
8Most of Ceph is licensed under the LGPL version 2.1. Some
9miscellaneous code is under BSD-style license or is public domain.
10The documentation is licensed under Creative Commons
94b18763 11Attribution Share Alike 3.0 (CC-BY-SA-3.0). There are a handful of headers
7c673cae
FG
12included here that are licensed under the GPL. Please see the file
13COPYING for a full inventory of licenses by file.
14
15Code contributions must include a valid "Signed-off-by" acknowledging
16the license for the modified or contributed file. Please see the file
17SubmittingPatches.rst for details on what that means and on how to
18generate and submit patches.
19
20We do not require assignment of copyright to contribute code; code is
21contributed under the terms of the applicable license.
22
23
24## Checking out the source
25
26You can clone from github with
27
28 git clone git@github.com:ceph/ceph
29
30or, if you are not a github user,
31
32 git clone git://github.com/ceph/ceph
33
34Ceph contains many git submodules that need to be checked out with
35
36 git submodule update --init --recursive
37
38
39## Build Prerequisites
40
41The list of Debian or RPM packages dependencies can be installed with:
42
43 ./install-deps.sh
44
45
46## Building Ceph
47
48Note that these instructions are meant for developers who are
49compiling the code for development and testing. To build binaries
50suitable for installation we recommend you build deb or rpm packages,
c07f9fc5 51or refer to the `ceph.spec.in` or `debian/rules` to see which
7c673cae
FG
52configuration options are specified for production builds.
53
54Prerequisite: CMake 2.8.11
55
56Build instructions:
57
58 ./do_cmake.sh
59 cd build
60 make
61
62This assumes you make your build dir a subdirectory of the ceph.git
c07f9fc5 63checkout. If you put it elsewhere, just replace `..` in do_cmake.sh with a
7c673cae
FG
64correct path to the checkout.
65
66To build only certain targets use:
67
68 make [target name]
69
70To install:
71
72 make install
73
74### CMake Options
75
76If you run the `cmake` command by hand, there are many options you can
77set with "-D". For example the option to build the RADOS Gateway is
78defaulted to ON. To build without the RADOS Gateway:
79
80 cmake -DWITH_RADOSGW=OFF [path to top level ceph directory]
81
82Another example below is building with debugging and alternate locations
83for a couple of external dependencies:
84
85 cmake -DLEVELDB_PREFIX="/opt/hyperleveldb" -DOFED_PREFIX="/opt/ofed" \
86 -DCMAKE_INSTALL_PREFIX=/opt/accelio -DCMAKE_C_FLAGS="-O0 -g3 -gdwarf-4" \
87 ..
88
89To view an exhaustive list of -D options, you can invoke `cmake` with:
90
91 cmake -LH
92
93If you often pipe `make` to `less` and would like to maintain the
94diagnostic colors for errors and warnings (and if your compiler
95supports it), you can invoke `cmake` with:
96
97 cmake -DDIAGNOSTICS_COLOR=always ..
98
99Then you'll get the diagnostic colors when you execute:
100
101 make | less -R
102
103Other available values for 'DIAGNOSTICS_COLOR' are 'auto' (default) and
104'never'.
105
106
107## Building a source tarball
108
109To build a complete source tarball with everything needed to build from
110source and/or build a (deb or rpm) package, run
111
112 ./make-dist
113
114This will create a tarball like ceph-$version.tar.bz2 from git.
115(Ensure that any changes you want to include in your working directory
116are committed to git.)
117
118
119## Running a test cluster
120
121To run a functional test cluster,
122
123 cd build
124 make vstart # builds just enough to run vstart
125 ../src/vstart.sh -d -n -x -l
126 ./bin/ceph -s
127
128Almost all of the usual commands are available in the bin/ directory.
129For example,
130
131 ./bin/rados -p rbd bench 30 write
132 ./bin/rbd create foo --size 1000
133
134To shut down the test cluster,
135
136 ../src/stop.sh
137
138To start or stop individual daemons, the sysvinit script can be used:
139
140 ./bin/init-ceph restart osd.0
141 ./bin/init-ceph stop
142
143
144## Running unit tests
145
146To build and run all tests (in parallel using all processors), use `ctest`:
147
148 cd build
149 make
150 ctest -j$(nproc)
151
152(Note: Many targets built from src/test are not run using `ctest`.
153Targets starting with "unittest" are run in `make check` and thus can
154be run with `ctest`. Targets starting with "ceph_test" can not, and should
155be run by hand.)
156
157When failures occur, look in build/Testing/Temporary for logs.
158
159To build and run all tests and their dependencies without other
160unnecessary targets in Ceph:
161
162 cd build
163 make check -j$(nproc)
164
165To run an individual test manually, run `ctest` with -R (regex matching):
166
167 ctest -R [regex matching test name(s)]
168
169(Note: `ctest` does not build the test it's running or the dependencies needed
170to run it)
171
172To run an individual test manually and see all the tests output, run
173`ctest` with the -V (verbose) flag:
174
175 ctest -V -R [regex matching test name(s)]
176
177To run an tests manually and run the jobs in parallel, run `ctest` with
c07f9fc5 178the `-j` flag:
7c673cae
FG
179
180 ctest -j [number of jobs]
181
182There are many other flags you can give `ctest` for better control
183over manual test execution. To view these options run:
184
185 man ctest
186
187
188## Building the Documentation
189
190### Prerequisites
191
192The list of package dependencies for building the documentation can be
c07f9fc5 193found in `doc_deps.deb.txt`:
7c673cae
FG
194
195 sudo apt-get install `cat doc_deps.deb.txt`
196
197### Building the Documentation
198
199To build the documentation, ensure that you are in the top-level
c07f9fc5 200`/ceph` directory, and execute the build script. For example:
7c673cae
FG
201
202 admin/build-doc
203