]> git.proxmox.com Git - ceph.git/blob - ceph/doc/man/8/rados.rst
import 15.2.5
[ceph.git] / ceph / doc / man / 8 / rados.rst
1 :orphan:
2
3 =======================================
4 rados -- rados object storage utility
5 =======================================
6
7 .. program:: rados
8
9 Synopsis
10 ========
11
12 | **rados** [ *options* ] [ *command* ]
13
14
15 Description
16 ===========
17
18 **rados** is a utility for interacting with a Ceph object storage
19 cluster (RADOS), part of the Ceph distributed storage system.
20
21
22 Options
23 =======
24
25 .. option:: -p pool, --pool pool
26
27 Interact with the given pool. Required by most commands.
28
29 .. option:: --pgid
30
31 As an alternative to ``--pool``, ``--pgid`` also allow users to specify the
32 PG id to which the command will be directed. With this option, certain
33 commands like ``ls`` allow users to limit the scope of the command to the given PG.
34
35 .. option:: -N namespace, --namespace namespace
36
37 Specify the rados namespace to use for the object.
38
39 .. option:: -s snap, --snap snap
40
41 Read from the given pool snapshot. Valid for all pool-specific read operations.
42
43 .. option:: -i infile
44
45 will specify an input file to be passed along as a payload with the
46 command to the monitor cluster. This is only used for specific
47 monitor commands.
48
49 .. option:: -o outfile
50
51 will write any payload returned by the monitor cluster with its
52 reply to outfile. Only specific monitor commands (e.g. osd getmap)
53 return a payload.
54
55 .. option:: -c ceph.conf, --conf=ceph.conf
56
57 Use ceph.conf configuration file instead of the default
58 /etc/ceph/ceph.conf to determine monitor addresses during startup.
59
60 .. option:: -m monaddress[:port]
61
62 Connect to specified monitor (instead of looking through ceph.conf).
63
64 .. option:: -b block_size
65
66 Set the block size for put/get/append ops and for write benchmarking.
67
68 .. option:: --striper
69
70 Uses the striping API of rados rather than the default one.
71 Available for stat, stat2, get, put, append, truncate, rm, ls
72 and all xattr related operation
73
74 .. option:: -O object_size
75
76 Set the object size for put/get ops and for write benchmarking
77
78 .. option:: --lock-cookie locker-cookie
79
80 Will set the lock cookie for acquiring advisory lock (lock get command).
81 If the cookie is not empty, this option must be passed to lock break command
82 to find the correct lock when releasing lock.
83
84
85 Global commands
86 ===============
87
88 :command:`lspools`
89 List object pools
90
91 :command:`df`
92 Show utilization statistics, including disk usage (bytes) and object
93 counts, over the entire system and broken down by pool.
94
95 :command:`list-inconsistent-pg` *pool*
96 List inconsistent PGs in given pool.
97
98 :command:`list-inconsistent-obj` *pgid*
99 List inconsistent objects in given PG.
100
101 :command:`list-inconsistent-snapset` *pgid*
102 List inconsistent snapsets in given PG.
103
104
105 Pool specific commands
106 ======================
107
108 :command:`get` *name* *outfile*
109 Read object name from the cluster and write it to outfile.
110
111 :command:`put` *name* *infile* [--offset offset]
112 Write object name with start offset (default:0) to the cluster with contents from infile.
113 **Warning:** The put command creates a single RADOS object, sized just as
114 large as your input file. Unless your objects are of reasonable and consistent sizes, that
115 is probably not what you want -- consider using RGW/S3, CephFS, or RBD instead.
116
117 :command:`append` *name* *infile*
118 Append object name to the cluster with contents from infile.
119
120 :command:`rm` *name*
121 Remove object name.
122
123 :command:`listwatchers` *name*
124 List the watchers of object name.
125
126 :command:`ls` *outfile*
127 List objects in the given pool and write to outfile. Instead of ``--pool`` if ``--pgid`` will be specified, ``ls`` will only list the objects in the given PG.
128
129 :command:`lssnap`
130 List snapshots for given pool.
131
132 :command:`clonedata` *srcname* *dstname* --object-locator *key*
133 Clone object byte data from *srcname* to *dstname*. Both objects must be stored with the locator key *key* (usually either *srcname* or *dstname*). Object attributes and omap keys are not copied or cloned.
134
135 :command:`mksnap` *foo*
136 Create pool snapshot named *foo*.
137
138 :command:`rmsnap` *foo*
139 Remove pool snapshot named *foo*.
140
141 :command:`bench` *seconds* *mode* [ -b *objsize* ] [ -t *threads* ]
142 Benchmark for *seconds*. The mode can be *write*, *seq*, or
143 *rand*. *seq* and *rand* are read benchmarks, either
144 sequential or random. Before running one of the reading benchmarks,
145 run a write benchmark with the *--no-cleanup* option. The default
146 object size is 4 MB, and the default number of simulated threads
147 (parallel writes) is 16. The *--run-name <label>* option is useful
148 for benchmarking a workload test from multiple clients. The *<label>*
149 is an arbitrary object name. It is "benchmark_last_metadata" by
150 default, and is used as the underlying object name for "read" and
151 "write" ops.
152 Note: -b *objsize* option is valid only in *write* mode.
153 Note: *write* and *seq* must be run on the same host otherwise the
154 objects created by *write* will have names that will fail *seq*.
155
156 :command:`cleanup` [ --run-name *run_name* ] [ --prefix *prefix* ]
157 Clean up a previous benchmark operation.
158 Note: the default run-name is "benchmark_last_metadata"
159
160 :command:`listxattr` *name*
161 List all extended attributes of an object.
162
163 :command:`getxattr` *name* *attr*
164 Dump the extended attribute value of *attr* of an object.
165
166 :command:`setxattr` *name* *attr* *value*
167 Set the value of *attr* in the extended attributes of an object.
168
169 :command:`rmxattr` *name* *attr*
170 Remove *attr* from the extended attributes of an object.
171
172 :command:`stat` *name*
173 Get stat (ie. mtime, size) of given object
174
175 :command:`stat2` *name*
176 Get stat (similar to stat, but with high precision time) of given object
177
178 :command:`listomapkeys` *name*
179 List all the keys stored in the object map of object name.
180
181 :command:`listomapvals` *name*
182 List all key/value pairs stored in the object map of object name.
183 The values are dumped in hexadecimal.
184
185 :command:`getomapval` [ --omap-key-file *file* ] *name* *key* [ *out-file* ]
186 Dump the hexadecimal value of key in the object map of object name.
187 If the optional *out-file* argument is not provided, the value will be
188 written to standard output.
189
190 :command:`setomapval` [ --omap-key-file *file* ] *name* *key* [ *value* ]
191 Set the value of key in the object map of object name. If the optional
192 *value* argument is not provided, the value will be read from standard
193 input.
194
195 :command:`rmomapkey` [ --omap-key-file *file* ] *name* *key*
196 Remove key from the object map of object name.
197
198 :command:`getomapheader` *name*
199 Dump the hexadecimal value of the object map header of object name.
200
201 :command:`setomapheader` *name* *value*
202 Set the value of the object map header of object name.
203
204 :command:`export` *filename*
205 Serialize pool contents to a file or standard output.\n"
206
207 :command:`import` [--dry-run] [--no-overwrite] < filename | - >
208 Load pool contents from a file or standard input
209
210
211 Examples
212 ========
213
214 To view cluster utilization::
215
216 rados df
217
218 To get a list object in pool foo sent to stdout::
219
220 rados -p foo ls -
221
222 To get a list of objects in PG 0.6::
223
224 rados --pgid 0.6 ls
225
226 To write an object::
227
228 rados -p foo put myobject blah.txt
229
230 To create a snapshot::
231
232 rados -p foo mksnap mysnap
233
234 To delete the object::
235
236 rados -p foo rm myobject
237
238 To read a previously snapshotted version of an object::
239
240 rados -p foo -s mysnap get myobject blah.txt.old
241
242 To list inconsistent objects in PG 0.6::
243
244 rados list-inconsistent-obj 0.6 --format=json-pretty
245
246
247 Availability
248 ============
249
250 **rados** is part of Ceph, a massively scalable, open-source, distributed storage system. Please refer to
251 the Ceph documentation at http://ceph.com/docs for more information.
252
253
254 See also
255 ========
256
257 :doc:`ceph <ceph>`\(8)