OSD documentation improvements
v2 cover OSD documentation improvements
Patch 1 imports the documentation from the wiki to the new file doc/doc/control.rst of the git repo. It is just the result of a cut & paste operation. The other patches of the series aim for a complete and up to date documentation for all osd subcommands.
Changes to V1:
* Proper SOB for all patches,
* Address Gregory Farnum's comment on Patch 5/6 of V1,
* Put things in doc/control.rst rather than doc/ops/monitor.rst and change title to Control commands on Tommi Virtanen's request.
Some OSD subcommands still lack useful descriptions. For example it's not clear (to me at least) what's the point of the osd "in" and "out" commands. But this can easily be improved later, so I'd propose to merge this version of the patch series.
BTW: I tried to rebase against the current master branch. However, as it turned out, ditaa is now required for building the documentation and there is no package for my distribution (lucid). Ditaa from SVN didn't like my java version, so I gave up and did not rebase.
Andre
PATCH v2 2/6 doc: Add documentation of missing osd commands.
The set of OSD commands which added by the previous commit is incomplete. This patch adds documentation for the following OSD commands which were previously missing: dump, tree, crush, cluster_snap, lost, create, rm.
--- doc/control.rst | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 41 insertions(+), 3 deletions(-)
doc/control.rst +41 -3
@@ -64,9 +64,48 @@ file. This is functionally equivalent to :: $ ceph osd getmap -o /tmp/osdmap $ osdmaptool /tmp/osdmap --export-crush file - :: + $ ceph osd dump [--format format>] + +Dump the osd map. Valid formats for -f are "plain" and "json". If no +--format option is given, the osd map is dumped as plain text. :: + + $ ceph osd tree [--format format] + +Dump the osd map as a tree with one line per osd containing weight +and state. :: + + $ ceph osd crush add <id> <name> <weight> [<loc1> [<loc2> ...]] + +Add a new item with the given id/name/weight at the specified +location. :: + + $ ceph osd crush remove <id> + +Remove an existing item from the crush map. :: + + $ ceph osd crush reweight <name> <weight> + +Set the weight of the item given by ``<name>`` to ``<weight>``. :: + + $ ceph osd cluster_snap <name> + +Create a cluster snapshot. :: + + $ ceph osd lost [--yes-i-really-mean-it] + +Mark an OSD as lost. This may result in permanent data loss. Use with caution. :: + + $ ceph osd create [<id>] + +Create a new OSD. If no ID is given, a new ID is automatically selected +if possible. :: + + $ ceph osd rm [<id>...] + +Remove the given OSD(s). :: + $ ceph osd getmaxosd Query the current max_osd parameter in the osd map. ::
@@ -179,5 +218,4 @@ Enables debug messages. :: Displays the status of all metadata servers. -dump, getmap, stop, set_max_mds, setmap: TODO - +set_max_mds: TODO
Signature · 1 line
1.7.8.rc1.14.g248db
PATCH v2 1/6 doc: Import the list of ceph subcommands from wiki.
In reply to Andre NollThis adds the content of the wiki page at
http://ceph.newdream.net/wiki/Monitor_commands
to doc/control.rst in order to make it available at the new official location for the ceph documentation. This first patch is just the result of a cut-and-paste operation. There are no changes in content, but the text was converted to rst format.
--- doc/control.rst | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ doc/index.rst | 1 + 2 files changed, 184 insertions(+), 0 deletions(-)
doc/control.rst new file +183 -0
@@ -0,0 +1,183 @@ +.. index:: control, commands + +================= + Control commands +================= + +Monitor commands +---------------- + +Monitor commands are issued using the ceph utility (in versions before +Dec08 it was called cmonctl):: + + $ ceph [-m monhost] command + +where the command is usually of the form:: + + $ ceph subsystem command + +System commands +--------------- + +:: + + $ ceph stop + +Cleanly shuts down the cluster. :: + + $ ceph -s + +Shows an overview of the current status of the cluster. :: + + $ ceph -w + +Shows a running summary of the status of the cluster, and major events. + +AUTH subsystem +-------------- +:: + + $ ceph auth add <osd> <--in-file|-i> <path-to-osd-keyring> + +Add auth keyring for an osd. :: + + $ ceph auth list + +Show auth key OSD subsystem. + +OSD subsystem +------------- +:: + + $ ceph osd stat + +Query osd subsystem status. :: + + $ ceph osd getmap -o file + +Write a copy of the most recent osd map to a file. See osdmaptool. :: + + $ ceph osd getcrushmap -o file + +Write a copy of the crush map from the most recent osd map to +file. This is functionally equivalent to :: + + $ ceph osd getmap -o /tmp/osdmap + $ osdmaptool /tmp/osdmap --export-crush file + +:: + + $ ceph osd getmaxosd + +Query the current max_osd parameter in the osd map. :: + + $ ceph osd setmap -i file + +Import the given osd map. Note that this can be a bit dangerous, +since the osd map includes dynamic state about which OSDs are current +on or offline; only do this if you've just modified a (very) recent +copy of the map. :: + + $ ceph osd setcrushmap -i file + +Import the given crush map. :: + + $ ceph osd setmaxosd + +Set the max_osd parameter in the osd map. This is necessary when +expanding the storage cluster. :: + + $ ceph osd down N + +Mark osdN down. :: + + $ ceph osd out N + +Mark osdN out of the distribution (i.e. allocated no data). :: + + $ ceph osd in N + +Mark osdN in the distribution (i.e. allocated data). :: + + $ ceph class list + +List classes that are loaded in the ceph cluster. :: + + $ ceph osd pause + $ ceph osd unpause + +TODO :: + + $ ceph osd reweight N W + +Sets the weight of osdN to W. :: + + $ ceph osd reweight-by-utilization [threshold] + +Reweights all the OSDs by reducing the weight of OSDs which are +heavily overused. By default it will adjust the weights downward on +OSDs which have 120% of the average utilization, but if you include +threshold it will use that percentage instead. :: + + $ ceph osd blacklist add ADDRESS[:source_port] [TIME] + $ ceph osd blacklist rm ADDRESS[:source_port] + +Adds/removes the address to/from the blacklist. When adding an address, +you can specify how long it should be blacklisted in seconds; otherwise +it will default to 1 hour. A blacklisted address is prevented from +connecting to any osd. Blacklisting is most often used to prevent a +laggy mds making bad changes to data on the osds. + +These commands are mostly only useful for failure testing, as +blacklists are normally maintained automatically and shouldn't need +manual intervention. :: + + $ ceph osd pool mksnap POOL SNAPNAME + $ ceph osd pool rmsnap POOL SNAPNAME + +Creates/deletes a snapshot of a pool. :: + + $ ceph osd pool create POOL + $ ceph osd pool delete POOL + +Creates/deletes a storage pool. :: + + $ ceph osd pool set POOL FIELD VALUE + +Changes a pool setting. Valid fields are: + + * ``size``: Sets the number of copies of data in the pool. + * ``pg_num``: TODO + * ``pgp_num``: TODO + +:: + + $ ceph osd scrub N + +Sends a scrub command to osdN. To send the command to all osds, use ``*``. +TODO: what does this actually do :: + + $ ceph osd repair N + +Sends a repair command to osdN. To send the command to all osds, use ``*``. +TODO: what does this actually do + +MDS subsystem +------------- + +Change configuration parameters on a running mds. :: + + $ ceph mds tell <mds-id> injectargs '--<switch> <value> [--<switch> <value>]' + +Example:: + + $ ceph mds tell 0 injectargs '--debug_ms 1 --debug_mds 10' + +Enables debug messages. :: + + $ ceph mds stat + +Displays the status of all metadata servers. + +dump, getmap, stop, set_max_mds, setmap: TODO +
doc/index.rst +1 -0
@@ -105,6 +105,7 @@ Table of Contents ops/index rec/index config + control api/index Internals <dev/index> man/index
Signature · 1 line
1.7.8.rc1.14.g248db
PATCH v2 3/6 doc: Document pause and unpause osd commands.
In reply to Andre NollThese two commands were undocumented so far. This patch adds a short description.
--- doc/control.rst | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
doc/control.rst +3 -1
@@ -145,7 +145,9 @@ List classes that are loaded in the ceph cluster. :: $ ceph osd pause $ ceph osd unpause -TODO :: +Set or clear the pause flags in the OSD map. If set, no IO requests +will be sent to any OSD. Clearing the flags via unpause results in +resending pending requests. :: $ ceph osd reweight N W
Signature · 1 line
1.7.8.rc1.14.g248db
PATCH v2 4/6 doc: Update the list of fields for the pool set command.
In reply to Andre NollThis list was lacking a few fields: crash_replay_interval, pg_num, pgp_num and crush_ruleset. Include these fields and add add short descriptions.
--- doc/control.rst | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
doc/control.rst +6 -2
@@ -64,6 +64,7 @@ file. This is functionally equivalent to :: $ ceph osd getmap -o /tmp/osdmap $ osdmaptool /tmp/osdmap --export-crush file + :: $ ceph osd dump [--format format>]
@@ -188,8 +189,11 @@ Creates/deletes a storage pool. :: Changes a pool setting. Valid fields are: * ``size``: Sets the number of copies of data in the pool. - * ``pg_num``: TODO - * ``pgp_num``: TODO + * ``crash_replay_interval``: The number of seconds to allow + clients to replay acknowledged but uncommited requests. + * ``pg_num``: The placement group number. + * ``pgp_num``: Effective number when calculating pg placement. + * ``crush_ruleset``: rule number for mapping placement. ::
Signature · 1 line
1.7.8.rc1.14.g248db
PATCH v2 5/6 doc: Add missing documentation for osd pool get.
In reply to Andre Noll"osd pool set" was already documented, but the corresponding "get" command was not. This patch adds the list of valid fields for this command, together with short descriptions.
Thanks to Gregory Farnum for pointing out a flaw in the description of lpl_num and lpgp_num in an earlier version of the patch.
--- doc/control.rst | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
doc/control.rst +11 -0
@@ -197,6 +197,17 @@ Changes a pool setting. Valid fields are: :: + $ ceph osd pool get POOL FIELD + +Get the value of a pool setting. Valid fields are: + + * ``pg_num``: See above. + * ``pgp_num``: See above. + * ``lpg_num``: The number of local PGs. + * ``lpgp_num``: The number used for placing the local PGs. + +:: + $ ceph osd scrub N Sends a scrub command to osdN. To send the command to all osds, use ``*``.
Signature · 1 line
1.7.8.rc1.14.g248db
PATCH v2 6/6 doc: Clarify documentation of reweight command.
In reply to Andre NollThis caused some discussions on the mailing list, so let's try to be clear about the meaning of an OSD weight.
--- doc/control.rst | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
doc/control.rst +3 -1
@@ -152,7 +152,9 @@ resending pending requests. :: $ ceph osd reweight N W -Sets the weight of osdN to W. :: +Set the weight of osdN to W. Two OSDs with the same weight will receive +roughly the same number of I/O requests and store approximately the +same amount of data. :: $ ceph osd reweight-by-utilization [threshold]
Signature · 1 line
1.7.8.rc1.14.g248db
Quoted 4 lines · Andre Noll
Patch 1 imports the documentation from the wiki to the new file
doc/doc/control.rstof the git repo. It is just the result of a cut & paste operation. The other patches of the series aim for a complete and up to date documentation for all osd subcommands.
Thanks, I really appreciate this work. I'll merge it in on Monday.
Quoted 5 lines · Tommi Virtanen
Quoted 4 lines
Patch 1 imports the documentation from the wiki to the new file
doc/doc/control.rstof the git repo. It is just the result of a cut & paste operation. The other patches of the series aim for a complete and up to date documentation for all osd subcommands.Thanks, I really appreciate this work. I'll merge it in on Monday.
Merged and updated, http://ceph.newdream.net/docs/latest/control/
Thank you.