~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to doc/control.rst

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.. index:: control, commands
 
2
 
 
3
=================
 
4
 Control commands
 
5
=================
 
6
 
 
7
Monitor commands
 
8
----------------
 
9
 
 
10
Monitor commands are issued using the ceph utility::
 
11
 
 
12
        $ ceph [-m monhost] command
 
13
 
 
14
where the command is usually (though not always) of the form::
 
15
 
 
16
        $ ceph subsystem command
 
17
 
 
18
System commands
 
19
---------------
 
20
 
 
21
::
 
22
 
 
23
        $ ceph stop
 
24
 
 
25
Cleanly shuts down the cluster.  ::
 
26
 
 
27
        $ ceph -s
 
28
 
 
29
Shows an overview of the current status of the cluster.  ::
 
30
 
 
31
        $ ceph -w
 
32
 
 
33
Shows a running summary of the status of the cluster, and major events.
 
34
 
 
35
        $ ceph quorum_status
 
36
 
 
37
Show the monitor quorum, including which monitors are participating and which one
 
38
is the leader.
 
39
 
 
40
        $ ceph [-m monhost] mon_status
 
41
 
 
42
Query the status of a single monitor, including whether or not it is in the quorum.
 
43
 
 
44
 
 
45
AUTH subsystem
 
46
--------------
 
47
::
 
48
 
 
49
        $ ceph auth add <osd> <--in-file|-i> <path-to-osd-keyring>
 
50
 
 
51
Add auth keyring for an osd.  ::
 
52
 
 
53
        $ ceph auth list
 
54
 
 
55
Show auth key OSD subsystem.
 
56
 
 
57
PG subsystem
 
58
------------
 
59
::
 
60
 
 
61
        $ ceph -- pg dump [--format <format>]
 
62
 
 
63
Output the stats of all pgs. Valid formats are "plain" and "json",
 
64
and plain is the default. ::
 
65
 
 
66
        $ ceph -- pg dump_stuck inactive|unclean|stale [--format <format>] [-t|--threshold <seconds>]
 
67
 
 
68
Output the stats of all PGs stuck in the specified state.
 
69
 
 
70
``--format`` may be ``plain`` (default) or ``json``
 
71
 
 
72
``--threshold`` defines how many seconds "stuck" is (default: 300)
 
73
 
 
74
**Inactive** PGs cannot process reads or writes because they are waiting for an OSD
 
75
with the most up-to-date data to come back.
 
76
 
 
77
**Unclean** PGs contain objects that are not replicated the desired number
 
78
of times. They should be recovering.
 
79
 
 
80
**Stale** PGs are in an unknown state - the OSDs that host them have not
 
81
reported to the monitor cluster in a while (configured by
 
82
mon_osd_report_timeout). ::
 
83
 
 
84
        $ ceph pg <pgid> mark_unfound_lost revert
 
85
 
 
86
Revert "lost" objects to their prior state, either a previous version
 
87
or delete them if they were just created.
 
88
 
 
89
 
 
90
OSD subsystem
 
91
-------------
 
92
::
 
93
 
 
94
        $ ceph osd stat
 
95
 
 
96
Query osd subsystem status. ::
 
97
 
 
98
        $ ceph osd getmap -o file
 
99
 
 
100
Write a copy of the most recent osd map to a file. See
 
101
:doc:`osdmaptool </man/8/osdmaptool>`. ::
 
102
 
 
103
        $ ceph osd getcrushmap -o file
 
104
 
 
105
Write a copy of the crush map from the most recent osd map to
 
106
file. This is functionally equivalent to ::
 
107
 
 
108
        $ ceph osd getmap -o /tmp/osdmap
 
109
        $ osdmaptool /tmp/osdmap --export-crush file
 
110
 
 
111
::
 
112
 
 
113
        $ ceph osd dump [--format <format>]
 
114
 
 
115
Dump the osd map. Valid formats for -f are "plain" and "json". If no
 
116
--format option is given, the osd map is dumped as plain text. ::
 
117
 
 
118
        $ ceph osd tree [--format <format>]
 
119
 
 
120
Dump the osd map as a tree with one line per osd containing weight
 
121
and state. ::
 
122
 
 
123
        $ ceph osd crush add <id> <name> <weight> [<loc1> [<loc2> ...]]
 
124
 
 
125
Add a new item with the given id/name/weight at the specified
 
126
location. ::
 
127
 
 
128
        $ ceph osd crush remove <id>
 
129
 
 
130
Remove an existing item from the crush map. ::
 
131
 
 
132
        $ ceph osd crush reweight <name> <weight>
 
133
 
 
134
Set the weight of the item given by ``<name>`` to ``<weight>``. ::
 
135
 
 
136
        $ ceph osd cluster_snap <name>
 
137
 
 
138
Create a cluster snapshot. ::
 
139
 
 
140
        $ ceph osd lost [--yes-i-really-mean-it]
 
141
 
 
142
Mark an OSD as lost. This may result in permanent data loss. Use with caution. ::
 
143
 
 
144
        $ ceph osd create [<id>]
 
145
 
 
146
Create a new OSD. If no ID is given, a new ID is automatically selected
 
147
if possible. ::
 
148
 
 
149
        $ ceph osd rm [<id>...]
 
150
 
 
151
Remove the given OSD(s). ::
 
152
 
 
153
        $ ceph osd getmaxosd
 
154
 
 
155
Query the current max_osd parameter in the osd map. ::
 
156
 
 
157
        $ ceph osd setmap -i file
 
158
 
 
159
Import the given osd map. Note that this can be a bit dangerous,
 
160
since the osd map includes dynamic state about which OSDs are current
 
161
on or offline; only do this if you've just modified a (very) recent
 
162
copy of the map. ::
 
163
 
 
164
        $ ceph osd setcrushmap -i file
 
165
 
 
166
Import the given crush map. ::
 
167
 
 
168
        $ ceph osd setmaxosd
 
169
 
 
170
Set the max_osd parameter in the osd map. This is necessary when
 
171
expanding the storage cluster. ::
 
172
 
 
173
        $ ceph osd down N
 
174
 
 
175
Mark osdN down. ::
 
176
 
 
177
        $ ceph osd out N
 
178
 
 
179
Mark osdN out of the distribution (i.e. allocated no data). ::
 
180
 
 
181
        $ ceph osd in N
 
182
 
 
183
Mark osdN in the distribution (i.e. allocated data). ::
 
184
 
 
185
        $ ceph class list
 
186
 
 
187
List classes that are loaded in the ceph cluster. ::
 
188
 
 
189
        $ ceph osd pause
 
190
        $ ceph osd unpause
 
191
 
 
192
Set or clear the pause flags in the OSD map. If set, no IO requests
 
193
will be sent to any OSD. Clearing the flags via unpause results in
 
194
resending pending requests. ::
 
195
 
 
196
        $ ceph osd reweight N W
 
197
 
 
198
Set the weight of osdN to W. Two OSDs with the same weight will receive
 
199
roughly the same number of I/O requests and store approximately the
 
200
same amount of data. ::
 
201
 
 
202
        $ ceph osd reweight-by-utilization [threshold]
 
203
 
 
204
Reweights all the OSDs by reducing the weight of OSDs which are
 
205
heavily overused. By default it will adjust the weights downward on
 
206
OSDs which have 120% of the average utilization, but if you include
 
207
threshold it will use that percentage instead. ::
 
208
 
 
209
        $ ceph osd blacklist add ADDRESS[:source_port] [TIME]
 
210
        $ ceph osd blacklist rm ADDRESS[:source_port]
 
211
 
 
212
Adds/removes the address to/from the blacklist. When adding an address,
 
213
you can specify how long it should be blacklisted in seconds; otherwise
 
214
it will default to 1 hour. A blacklisted address is prevented from
 
215
connecting to any osd. Blacklisting is most often used to prevent a
 
216
laggy mds making bad changes to data on the osds.
 
217
 
 
218
These commands are mostly only useful for failure testing, as
 
219
blacklists are normally maintained automatically and shouldn't need
 
220
manual intervention. ::
 
221
 
 
222
        $ ceph osd pool mksnap POOL SNAPNAME
 
223
        $ ceph osd pool rmsnap POOL SNAPNAME
 
224
 
 
225
Creates/deletes a snapshot of a pool. ::
 
226
 
 
227
        $ ceph osd pool create POOL [pg_num [pgp_num]]
 
228
        $ ceph osd pool delete POOL
 
229
        $ ceph osd pool rename OLDNAME NEWNAME
 
230
 
 
231
Creates/deletes/renames a storage pool. ::
 
232
 
 
233
        $ ceph osd pool set POOL FIELD VALUE
 
234
 
 
235
Changes a pool setting. Valid fields are:
 
236
 
 
237
        * ``size``: Sets the number of copies of data in the pool.
 
238
        * ``crash_replay_interval``: The number of seconds to allow
 
239
          clients to replay acknowledged but uncommited requests.
 
240
        * ``pg_num``: The placement group number.
 
241
        * ``pgp_num``: Effective number when calculating pg placement.
 
242
        * ``crush_ruleset``: rule number for mapping placement.
 
243
 
 
244
::
 
245
 
 
246
        $ ceph osd pool get POOL FIELD
 
247
 
 
248
Get the value of a pool setting. Valid fields are:
 
249
 
 
250
        * ``pg_num``: See above.
 
251
        * ``pgp_num``: See above.
 
252
        * ``lpg_num``: The number of local PGs.
 
253
        * ``lpgp_num``: The number used for placing the local PGs.
 
254
 
 
255
::
 
256
 
 
257
        $ ceph osd scrub N
 
258
 
 
259
Sends a scrub command to osdN. To send the command to all osds, use ``*``.
 
260
TODO: what does this actually do ::
 
261
 
 
262
        $ ceph osd repair N
 
263
 
 
264
Sends a repair command to osdN. To send the command to all osds, use ``*``.
 
265
TODO: what does this actually do
 
266
 
 
267
MDS subsystem
 
268
-------------
 
269
 
 
270
Change configuration parameters on a running mds. ::
 
271
 
 
272
        $ ceph mds tell <mds-id> injectargs '--<switch> <value> [--<switch> <value>]'
 
273
 
 
274
Example::
 
275
 
 
276
        $ ceph mds tell 0 injectargs '--debug_ms 1 --debug_mds 10'
 
277
 
 
278
Enables debug messages. ::
 
279
 
 
280
        $ ceph mds stat
 
281
 
 
282
Displays the status of all metadata servers.
 
283
 
 
284
.. todo:: ``ceph mds`` subcommands missing docs: set_max_mds, dump, getmap, stop, setmap
 
285
 
 
286
 
 
287
Mon subsystem
 
288
-------------
 
289
 
 
290
Show monitor stats::
 
291
 
 
292
        $ ceph mon stat
 
293
        2011-12-14 10:40:59.044395 mon <- [mon,stat]
 
294
        2011-12-14 10:40:59.057111 mon.1 -> 'e3: 5 mons at {a=10.1.2.3:6789/0,b=10.1.2.4:6789/0,c=10.1.2.5:6789/0,d=10.1.2.6:6789/0,e=10.1.2.7:6789/0}, election epoch 16, quorum 0,1,2,3' (0)
 
295
 
 
296
The ``quorum`` list at the end lists monitor nodes that are part of the current quorum.
 
297
 
 
298
This is also available more directly::
 
299
 
 
300
        $ ./ceph quorum_status
 
301
        2011-12-14 10:44:20.417705 mon <- [quorum_status]
 
302
        2011-12-14 10:44:20.431890 mon.0 -> '{ "election_epoch": 10,
 
303
          "quorum": [
 
304
                0,
 
305
                1,
 
306
                2],
 
307
          "monmap": { "epoch": 1,
 
308
              "fsid": "444b489c-4f16-4b75-83f0-cb8097468898",
 
309
              "modified": "2011-12-12 13:28:27.505520",
 
310
              "created": "2011-12-12 13:28:27.505520",
 
311
              "mons": [
 
312
                    { "rank": 0,
 
313
                      "name": "a",
 
314
                      "addr": "127.0.0.1:6789\/0"},
 
315
                    { "rank": 1,
 
316
                      "name": "b",
 
317
                      "addr": "127.0.0.1:6790\/0"},
 
318
                    { "rank": 2,
 
319
                      "name": "c",
 
320
                      "addr": "127.0.0.1:6791\/0"}]}}' (0)
 
321
 
 
322
The above will block until a quorum is reached.
 
323
 
 
324
For a status of just the monitor you connect to (use ``-m HOST:PORT``
 
325
to select)::
 
326
 
 
327
        $ ./ceph mon_status
 
328
        2011-12-14 10:45:30.644414 mon <- [mon_status]
 
329
        2011-12-14 10:45:30.644632 mon.0 -> '{ "name": "a",
 
330
          "rank": 0,
 
331
          "state": "leader",
 
332
          "election_epoch": 10,
 
333
          "quorum": [
 
334
                0,
 
335
                1,
 
336
                2],
 
337
          "outside_quorum": [],
 
338
          "monmap": { "epoch": 1,
 
339
              "fsid": "444b489c-4f16-4b75-83f0-cb8097468898",
 
340
              "modified": "2011-12-12 13:28:27.505520",
 
341
              "created": "2011-12-12 13:28:27.505520",
 
342
              "mons": [
 
343
                    { "rank": 0,
 
344
                      "name": "a",
 
345
                      "addr": "127.0.0.1:6789\/0"},
 
346
                    { "rank": 1,
 
347
                      "name": "b",
 
348
                      "addr": "127.0.0.1:6790\/0"},
 
349
                    { "rank": 2,
 
350
                      "name": "c",
 
351
                      "addr": "127.0.0.1:6791\/0"}]}}' (0)
 
352
 
 
353
A dump of the monitor state::
 
354
 
 
355
        $ ceph mon dump
 
356
        2011-12-14 10:43:08.015333 mon <- [mon,dump]
 
357
        2011-12-14 10:43:08.015567 mon.0 -> 'dumped monmap epoch 1' (0)
 
358
        epoch 1
 
359
        fsid 444b489c-4f16-4b75-83f0-cb8097468898
 
360
        last_changed 2011-12-12 13:28:27.505520
 
361
        created 2011-12-12 13:28:27.505520
 
362
        0: 127.0.0.1:6789/0 mon.a
 
363
        1: 127.0.0.1:6790/0 mon.b
 
364
        2: 127.0.0.1:6791/0 mon.c
 
365