rados8
Rados object storage utility
Usage
rados [options]
[command]
Overview
rados is a utility for interacting with a Ceph object storage cluster (RADOS), part of the Ceph distributed storage system.
Options
-
--object-locator object_locator -
Set object_locator for operation.
-
-p pool, --pool pool -
Interact with the given pool. Required by most commands.
-
--target-pool pool -
Select target pool by name.
-
--pgid -
As an alternative to
--pool,--pgidalso allow users to specify the PG id to which the command will be directed. With this option, certain commands likelsallow users to limit the scope of the command to the given PG.
-
-N namespace, --namespace namespace -
Specify the rados namespace to use for the object.
-
--all -
Use with ls to list objects in all namespaces. Put in CEPH_ARGS environment variable to make this the default.
-
--default -
Use with ls to list objects in default namespace. Takes precedence over --all in case --all is in environment.
-
-s snap, --snap snap -
Read from the given pool snapshot. Valid for all pool-specific read operations.
-
--create -
Create the pool or directory that was specified.
-
-i infile -
will specify an input file to be passed along as a payload with the command to the monitor cluster. This is only used for specific monitor commands.
-
-m monaddress[:port] -
Connect to specified monitor (instead of looking through ceph.conf).
-
-b block_size -
Set the block size for put/get/append ops and for write benchmarking.
-
--striper -
Uses the striping API of rados rather than the default one. Available for stat, stat2, get, put, append, truncate, rm, ls and all xattr related operation.
-
-O object_size, --object-size object_size -
Set the object size for put/get ops and for write benchmarking.
-
--max-objects -
Set the max number of objects for write benchmarking.
-
--lock-cookie locker-cookie -
Will set the lock cookie for acquiring advisory lock (lock get command). If the cookie is not empty, this option must be passed to lock break command to find the correct lock when releasing lock.
-
--target-locator -
Use with cp to specify the locator of the new object.
-
--target-nspace -
Use with cp to specify the namespace of the new object.
Options
-
-t N, --concurrent-ios=N -
Set number of concurrent I/O operations.
-
--show-time -
Prefix output with date/time.
-
--no-verify -
Do not verify contents of read objects.
-
--write-object -
Write contents to the objects.
-
--write-omap -
Write contents to the omap.
-
--write-xattr -
Write contents to the extended attributes.
Options
-
--num-objects -
Total number of objects.
-
--min-object-size -
Min object size.
-
--max-object-size -
Max object size.
-
--min-op-len -
Min io size of operations.
-
--max-op-len -
Max io size of operations.
-
--max-ops -
Max number of operations.
-
--max-backlog -
Max backlog size.
-
--read-percent -
Percent of operations that are read.
-
--target-throughput -
Target throughput (in bytes).
-
--run-length -
Total time (in seconds).
-
--offset-align -
At what boundary to align random op offsets.
Options
-
--with-clones -
Include clones when doing flush or evict.
Options
-
--omap-key-file file -
Read the omap key from a file.
Options
-
-c FILE, --conf FILE -
Read configuration from the given configuration file.
-
--id ID -
Set ID portion of my name.
-
-n TYPE.ID, --name TYPE.ID -
Set cephx user name.
-
--cluster NAME -
Set cluster name (default: ceph).
-
--setuser USER -
Set uid to user or uid (and gid to user's gid).
-
--setgroup GROUP -
Set gid to group or gid.
-
--version -
Show version and quit.
Global commands
lspools-
List object pools
df-
Show utilization statistics, including disk usage (bytes) and object counts, over the entire system and broken down by pool.
list-inconsistent-pgpool-
List inconsistent PGs in given pool.
list-inconsistent-objpgid-
List inconsistent objects in given PG.
list-inconsistent-snapsetpgid-
List inconsistent snapsets in given PG.
Pool specific commands
getname outfile-
Read object name from the cluster and write it to outfile.
putname infile [--offset offset]-
Write object name with start offset (default:0) to the cluster with contents from infile.
Warning:The put command creates a single RADOS object, sized just as large as your input file. Unless your objects are of reasonable and consistent sizes, that is probably not what you want -- consider using RGW/S3, CephFS, or RBD instead.
appendname infile-
Append object name to the cluster with contents from infile.
rm[--force-full] name ...-
Remove object(s) with name(s). With
--force-fullwill remove when cluster is marked full.
listwatchersname-
List the watchers of object name.
lsoutfile-
List objects in the given pool and write to outfile. Instead of
--poolif--pgidwill be specified,lswill only list the objects in the given PG.
lssnap-
List snapshots for given pool.
clonedatasrcname dstname --object-locator key-
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.
mksnapfoo-
Create pool snapshot named foo.
rmsnapfoo-
Remove pool snapshot named foo.
benchseconds mode [ -b objsize ] [ -t threads ]-
Benchmark for seconds. The mode can be write, seq, or rand. seq and rand are read benchmarks, either sequential or random. Before running one of the reading benchmarks, run a write benchmark with the --no-cleanup option. The default object size is 4 MB, and the default number of simulated threads (parallel writes) is 16. The --run-name <label> option is useful for benchmarking a workload test from multiple clients. The <label> is an arbitrary object name. It is "benchmark_last_metadata" by default, and is used as the underlying object name for "read" and "write" ops. Note: -b objsize option is valid only in write mode. Note: write and seq must be run on the same host otherwise the objects created by write will have names that will fail seq.
cleanup[ --run-name run_name ] [ --prefix prefix ]-
Clean up a previous benchmark operation. Note: the default run-name is "benchmark_last_metadata"
listxattrname-
List all extended attributes of an object.
getxattrname attr-
Dump the extended attribute value of attr of an object.
setxattrname attr value-
Set the value of attr in the extended attributes of an object.
rmxattrname attr-
Remove attr from the extended attributes of an object.
statname-
Get stat (ie. mtime, size) of given object
stat2name-
Get stat (similar to stat, but with high precision time) of given object
listomapkeysname-
List all the keys stored in the object map of object name.
listomapvalsname-
List all key/value pairs stored in the object map of object name. The values are dumped in hexadecimal.
getomapval[ --omap-key-file file ] name key [ out-file ]-
Dump the hexadecimal value of key in the object map of object name. If the optional out-file argument is not provided, the value will be written to standard output.
setomapval[ --omap-key-file file ] name key [ value ]-
Set the value of key in the object map of object name. If the optional value argument is not provided, the value will be read from standard input.
rmomapkey[ --omap-key-file file ] name key-
Remove key from the object map of object name.
getomapheadername-
Dump the hexadecimal value of the object map header of object name.
setomapheadername value-
Set the value of the object map header of object name.
exportfilename-
Serialize pool contents to a file or standard output.n"
import[--dry-run] [--no-overwrite] < filename | - >-
Load pool contents from a file or standard input
Examples
To view cluster utilization:
rados df
To get a list object in pool foo sent to stdout:
rados -p foo ls -
To get a list of objects in PG 0.6:
rados --pgid 0.6 ls
To write an object:
rados -p foo put myobject blah.txt
To create a snapshot:
rados -p foo mksnap mysnap
To delete the object:
rados -p foo rm myobject
To read a previously snapshotted version of an object:
rados -p foo -s mysnap get myobject blah.txt.old
To list inconsistent objects in PG 0.6:
rados list-inconsistent-obj 0.6 --format=json-pretty
Releases
6 releases since Debian 8 (Jessie); the text changed 5 times.
--all since Debian 12 (Bookworm);
--cluster since Debian 12 (Bookworm);
--concurrent-ios since Debian 12 (Bookworm);
--create since Debian 12 (Bookworm);
--default since Debian 12 (Bookworm);
--id since Debian 12 (Bookworm);
--lock-cookie since Debian 12 (Bookworm);
--max-backlog since Debian 12 (Bookworm);
--max-object-size since Debian 12 (Bookworm);
--max-objects since Debian 12 (Bookworm);
--max-op-len since Debian 12 (Bookworm);
--max-ops since Debian 12 (Bookworm);
--min-object-size since Debian 12 (Bookworm);
--min-op-len since Debian 12 (Bookworm);
--name since Debian 12 (Bookworm);
--namespace since Debian 11 (Bullseye);
--no-verify since Debian 12 (Bookworm);
--num-objects since Debian 12 (Bookworm);
--object-locator since Debian 12 (Bookworm);
--object-size since Debian 12 (Bookworm);
--offset-align since Debian 12 (Bookworm);
--omap-key-file since Debian 12 (Bookworm);
--pgid since Debian 11 (Bullseye);
--read-percent since Debian 12 (Bookworm);
--run-length since Debian 12 (Bookworm);
--setgroup since Debian 12 (Bookworm);
--setuser since Debian 12 (Bookworm);
--show-time since Debian 12 (Bookworm);
--striper since Debian 9 (Stretch);
--target-locator since Debian 12 (Bookworm);
--target-nspace since Debian 12 (Bookworm);
--target-pool since Debian 12 (Bookworm);
--target-throughput since Debian 12 (Bookworm);
--version since Debian 12 (Bookworm);
--with-clones since Debian 12 (Bookworm);
--write-object since Debian 12 (Bookworm);
--write-omap since Debian 12 (Bookworm);
--write-xattr since Debian 12 (Bookworm);
-N since Debian 11 (Bullseye);
-O since Debian 11 (Bullseye);
-b since Debian 9 (Stretch);
-n since Debian 12 (Bookworm);
-t since Debian 12 (Bookworm).
-o until Debian 11 (Bullseye).