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
74 .. option:: -O object_size
76 Set the object size for put/get ops and for write benchmarking
78 .. option:: --lock-cookie locker-cookie
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.
92 Show utilization statistics, including disk usage (bytes) and object
93 counts, over the entire system and broken down by pool.
95 :command:`list-inconsistent-pg` *pool*
96 List inconsistent PGs in given pool.
98 :command:`list-inconsistent-obj` *pgid*
99 List inconsistent objects in given PG.
101 :command:`list-inconsistent-snapset` *pgid*
102 List inconsistent snapsets in given PG.
105 Pool specific commands
106 ======================
108 :command:`get` *name* *outfile*
109 Read object name from the cluster and write it to outfile.
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.
117 :command:`append` *name* *infile*
118 Append object name to the cluster with contents from infile.
123 :command:`listwatchers` *name*
124 List the watchers of object name.
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.
130 List snapshots for given pool.
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.
135 :command:`mksnap` *foo*
136 Create pool snapshot named *foo*.
138 :command:`rmsnap` *foo*
139 Remove pool snapshot named *foo*.
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
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*.
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"
160 :command:`listxattr` *name*
161 List all extended attributes of an object.
163 :command:`getxattr` *name* *attr*
164 Dump the extended attribute value of *attr* of an object.
166 :command:`setxattr` *name* *attr* *value*
167 Set the value of *attr* in the extended attributes of an object.
169 :command:`rmxattr` *name* *attr*
170 Remove *attr* from the extended attributes of an object.
172 :command:`stat` *name*
173 Get stat (ie. mtime, size) of given object
175 :command:`stat2` *name*
176 Get stat (similar to stat, but with high precision time) of given object
178 :command:`listomapkeys` *name*
179 List all the keys stored in the object map of object name.
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.
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.
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
195 :command:`rmomapkey` [ --omap-key-file *file* ] *name* *key*
196 Remove key from the object map of object name.
198 :command:`getomapheader` *name*
199 Dump the hexadecimal value of the object map header of object name.
201 :command:`setomapheader` *name* *value*
202 Set the value of the object map header of object name.
204 :command:`export` *filename*
205 Serialize pool contents to a file or standard output.\n"
207 :command:`import` [--dry-run] [--no-overwrite] < filename | - >
208 Load pool contents from a file or standard input
214 To view cluster utilization::
218 To get a list object in pool foo sent to stdout::
222 To get a list of objects in PG 0.6::
228 rados -p foo put myobject blah.txt
230 To create a snapshot::
232 rados -p foo mksnap mysnap
234 To delete the object::
236 rados -p foo rm myobject
238 To read a previously snapshotted version of an object::
240 rados -p foo -s mysnap get myobject blah.txt.old
242 To list inconsistent objects in PG 0.6::
244 rados list-inconsistent-obj 0.6 --format=json-pretty
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.
257 :doc:`ceph <ceph>`\(8)