]> git.proxmox.com Git - ceph.git/blob - ceph/doc/man/8/rados.rst
import ceph 14.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
75 Global commands
76 ===============
77
78 :command:`lspools`
79 List object pools
80
81 :command:`df`
82 Show utilization statistics, including disk usage (bytes) and object
83 counts, over the entire system and broken down by pool.
84
85 :command:`list-inconsistent-pg` *pool*
86 List inconsistent PGs in given pool.
87
88 :command:`list-inconsistent-obj` *pgid*
89 List inconsistent objects in given PG.
90
91 :command:`list-inconsistent-snapset` *pgid*
92 List inconsistent snapsets in given PG.
93
94
95 Pool specific commands
96 ======================
97
98 :command:`get` *name* *outfile*
99 Read object name from the cluster and write it to outfile.
100
101 :command:`put` *name* *infile* [--offset offset]
102 Write object name with start offset (default:0) to the cluster with contents from infile.
103 **Warning:** The put command creates a single RADOS object, sized just as
104 large as your input file. Unless your objects are of reasonable and consistent sizes, that
105 is probably not what you want -- consider using RGW/S3, CephFS, or RBD instead.
106
107 :command:`append` *name* *infile*
108 Append object name to the cluster with contents from infile.
109
110 :command:`rm` *name*
111 Remove object name.
112
113 :command:`listwatchers` *name*
114 List the watchers of object name.
115
116 :command:`ls` *outfile*
117 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.
118
119 :command:`lssnap`
120 List snapshots for given pool.
121
122 :command:`clonedata` *srcname* *dstname* --object-locator *key*
123 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.
124
125 :command:`mksnap` *foo*
126 Create pool snapshot named *foo*.
127
128 :command:`rmsnap` *foo*
129 Remove pool snapshot named *foo*.
130
131 :command:`bench` *seconds* *mode* [ -b *objsize* ] [ -t *threads* ]
132 Benchmark for *seconds*. The mode can be *write*, *seq*, or
133 *rand*. *seq* and *rand* are read benchmarks, either
134 sequential or random. Before running one of the reading benchmarks,
135 run a write benchmark with the *--no-cleanup* option. The default
136 object size is 4 MB, and the default number of simulated threads
137 (parallel writes) is 16. The *--run-name <label>* option is useful
138 for benchmarking a workload test from multiple clients. The *<label>*
139 is an arbitrary object name. It is "benchmark_last_metadata" by
140 default, and is used as the underlying object name for "read" and
141 "write" ops.
142 Note: -b *objsize* option is valid only in *write* mode.
143 Note: *write* and *seq* must be run on the same host otherwise the
144 objects created by *write* will have names that will fail *seq*.
145
146 :command:`cleanup` [ --run-name *run_name* ] [ --prefix *prefix* ]
147 Clean up a previous benchmark operation.
148 Note: the default run-name is "benchmark_last_metadata"
149
150 :command:`listxattr` *name*
151 List all extended attributes of an object.
152
153 :command:`getxattr` *name* *attr*
154 Dump the extended attribute value of *attr* of an object.
155
156 :command:`setxattr` *name* *attr* *value*
157 Set the value of *attr* in the extended attributes of an object.
158
159 :command:`rmxattr` *name* *attr*
160 Remove *attr* from the extended attributes of an object.
161
162 :command:`stat` *name*
163 Get stat (ie. mtime, size) of given object
164
165 :command:`stat2` *name*
166 Get stat (similar to stat, but with high precision time) of given object
167
168 :command:`listomapkeys` *name*
169 List all the keys stored in the object map of object name.
170
171 :command:`listomapvals` *name*
172 List all key/value pairs stored in the object map of object name.
173 The values are dumped in hexadecimal.
174
175 :command:`getomapval` [ --omap-key-file *file* ] *name* *key* [ *out-file* ]
176 Dump the hexadecimal value of key in the object map of object name.
177 If the optional *out-file* argument is not provided, the value will be
178 written to standard output.
179
180 :command:`setomapval` [ --omap-key-file *file* ] *name* *key* [ *value* ]
181 Set the value of key in the object map of object name. If the optional
182 *value* argument is not provided, the value will be read from standard
183 input.
184
185 :command:`rmomapkey` [ --omap-key-file *file* ] *name* *key*
186 Remove key from the object map of object name.
187
188 :command:`getomapheader` *name*
189 Dump the hexadecimal value of the object map header of object name.
190
191 :command:`setomapheader` *name* *value*
192 Set the value of the object map header of object name.
193
194 :command:`export` *filename*
195 Serialize pool contents to a file or standard output.\n"
196
197 :command:`import` [--dry-run] [--no-overwrite] < filename | - >
198 Load pool contents from a file or standard input
199
200
201 Examples
202 ========
203
204 To view cluster utilization::
205
206 rados df
207
208 To get a list object in pool foo sent to stdout::
209
210 rados -p foo ls -
211
212 To get a list of objects in PG 0.6::
213
214 rados --pgid 0.6 ls
215
216 To write an object::
217
218 rados -p foo put myobject blah.txt
219
220 To create a snapshot::
221
222 rados -p foo mksnap mysnap
223
224 To delete the object::
225
226 rados -p foo rm myobject
227
228 To read a previously snapshotted version of an object::
229
230 rados -p foo -s mysnap get myobject blah.txt.old
231
232 To list inconsistent objects in PG 0.6::
233
234 rados list-inconsistent-obj 0.6 --format=json-pretty
235
236
237 Availability
238 ============
239
240 **rados** is part of Ceph, a massively scalable, open-source, distributed storage system. Please refer to
241 the Ceph documentation at http://ceph.com/docs for more information.
242
243
244 See also
245 ========
246
247 :doc:`ceph <ceph>`\(8)