rados – rados object storage utility

Synopsis

rados [ options ] [ command ]

Description

rados is a utility for interacting with a Ceph object storagecluster (RADOS), part of the Ceph distributed storage system.

Options

  • -p pool, —pool pool
  • Interact with the given pool. Required by most commands.
  • —pgid
  • As an alternative to —pool, —pgid also allow users to specify thePG id to which the command will be directed. With this option, certaincommands like ls allow 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.
  • -s snap, —snap snap
  • Read from the given pool snapshot. Valid for all pool-specific read operations.
  • -i infile
  • will specify an input file to be passed along as a payload with thecommand to the monitor cluster. This is only used for specificmonitor commands.
  • -o outfile
  • will write any payload returned by the monitor cluster with itsreply to outfile. Only specific monitor commands (e.g. osd getmap)return a payload.
  • -c ceph.conf, —conf=ceph.conf
  • Use ceph.conf configuration file instead of the default/etc/ceph/ceph.conf to determine monitor addresses during startup.
  • -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, lsand all xattr related operation
  • -O object_size
  • Set the object size for put/get ops and 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 commandto find the correct lock when releasing lock.

Global commands

  • lspools
  • List object pools

  • df

  • Show utilization statistics, including disk usage (bytes) and objectcounts, 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 aslarge as your input file. Unless your objects are of reasonable and consistent sizes, thatis 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.

  • rmname

  • Remove object name.

  • listwatchersname

  • List the watchers of object name.

  • lsoutfile

  • 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.

  • 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, orrand. seq and rand are read benchmarks, eithersequential or random. Before running one of the reading benchmarks,run a write benchmark with the –no-cleanup option. The defaultobject size is 4 MB, and the default number of simulated threads(parallel writes) is 16. The –run-name option is usefulfor benchmarking a workload test from multiple clients. The option is valid only in write mode.Note: write and seq must be run on the same host otherwise theobjects 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.

  • setxattrnameattrvalue

  • 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 bewritten 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 optionalvalue argument is not provided, the value will be read from standardinput.

  • 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:

  1. rados df

To get a list object in pool foo sent to stdout:

  1. rados -p foo ls -

To get a list of objects in PG 0.6:

  1. rados --pgid 0.6 ls

To write an object:

  1. rados -p foo put myobject blah.txt

To create a snapshot:

  1. rados -p foo mksnap mysnap

To delete the object:

  1. rados -p foo rm myobject

To read a previously snapshotted version of an object:

  1. rados -p foo -s mysnap get myobject blah.txt.old

To list inconsistent objects in PG 0.6:

  1. rados list-inconsistent-obj 0.6 --format=json-pretty

Availability

rados is part of Ceph, a massively scalable, open-source, distributed storage system. Please refer tothe Ceph documentation at http://ceph.com/docs for more information.

See also

ceph(8)