3 =======================================
4 rados -- rados object storage utility
5 =======================================
12 | **rados** [ *options* ] [ *command* ]
18 **rados** is a utility for interacting with a Ceph object storage
19 cluster (RADOS), part of the Ceph distributed storage system.
25 .. option:: -p pool, --pool pool
27 Interact with the given pool. Required by most commands.
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.
35 .. option:: -N namespace, --namespace namespace
37 Specify the rados namespace to use for the object.
39 .. option:: -s snap, --snap snap
41 Read from the given pool snapshot. Valid for all pool-specific read operations.
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
49 .. option:: -o outfile
51 will write any payload returned by the monitor cluster with its
52 reply to outfile. Only specific monitor commands (e.g. osd getmap)
55 .. option:: -c ceph.conf, --conf=ceph.conf
57 Use ceph.conf configuration file instead of the default
58 /etc/ceph/ceph.conf to determine monitor addresses during startup.
60 .. option:: -m monaddress[:port]
62 Connect to specified monitor (instead of looking through ceph.conf).
64 .. option:: -b block_size
66 Set the block size for put/get/append ops and for write benchmarking.
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
82 Show utilization statistics, including disk usage (bytes) and object
83 counts, over the entire system and broken down by pool.
85 :command:`list-inconsistent-pg` *pool*
86 List inconsistent PGs in given pool.
88 :command:`list-inconsistent-obj` *pgid*
89 List inconsistent objects in given PG.
91 :command:`list-inconsistent-snapset` *pgid*
92 List inconsistent snapsets in given PG.
95 Pool specific commands
96 ======================
98 :command:`get` *name* *outfile*
99 Read object name from the cluster and write it to outfile.
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.
107 :command:`append` *name* *infile*
108 Append object name to the cluster with contents from infile.
113 :command:`listwatchers` *name*
114 List the watchers of object name.
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.
120 List snapshots for given pool.
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.
125 :command:`mksnap` *foo*
126 Create pool snapshot named *foo*.
128 :command:`rmsnap` *foo*
129 Remove pool snapshot named *foo*.
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
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*.
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"
150 :command:`listxattr` *name*
151 List all extended attributes of an object.
153 :command:`getxattr` *name* *attr*
154 Dump the extended attribute value of *attr* of an object.
156 :command:`setxattr` *name* *attr* *value*
157 Set the value of *attr* in the extended attributes of an object.
159 :command:`rmxattr` *name* *attr*
160 Remove *attr* from the extended attributes of an object.
162 :command:`stat` *name*
163 Get stat (ie. mtime, size) of given object
165 :command:`stat2` *name*
166 Get stat (similar to stat, but with high precision time) of given object
168 :command:`listomapkeys` *name*
169 List all the keys stored in the object map of object name.
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.
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.
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
185 :command:`rmomapkey` [ --omap-key-file *file* ] *name* *key*
186 Remove key from the object map of object name.
188 :command:`getomapheader` *name*
189 Dump the hexadecimal value of the object map header of object name.
191 :command:`setomapheader` *name* *value*
192 Set the value of the object map header of object name.
194 :command:`export` *filename*
195 Serialize pool contents to a file or standard output.\n"
197 :command:`import` [--dry-run] [--no-overwrite] < filename | - >
198 Load pool contents from a file or standard input
204 To view cluster utilization::
208 To get a list object in pool foo sent to stdout::
212 To get a list of objects in PG 0.6::
218 rados -p foo put myobject blah.txt
220 To create a snapshot::
222 rados -p foo mksnap mysnap
224 To delete the object::
226 rados -p foo rm myobject
228 To read a previously snapshotted version of an object::
230 rados -p foo -s mysnap get myobject blah.txt.old
232 To list inconsistent objects in PG 0.6::
234 rados list-inconsistent-obj 0.6 --format=json-pretty
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.
247 :doc:`ceph <ceph>`\(8)