Skip to content

Commit bb8c4ea

Browse files
committed
Add documentation for Swift Recon.
Change-Id: I37f4fb624bdc5b8bbf2e691d29aa6b15cd648aa8
1 parent c1cbd82 commit bb8c4ea

File tree

3 files changed

+112
-1
lines changed

3 files changed

+112
-1
lines changed

doc/source/admin_guide.rst

+95
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,101 @@ place and then rerun the dispersion report::
222222
Sample represents 1.00% of the object partition space
223223

224224

225+
--------------------------------
226+
Cluster Telemetry and Monitoring
227+
--------------------------------
228+
229+
Various metrics and telemetry can be obtained from the object servers using
230+
the recon server middleware and the swift-recon cli. To do so update your
231+
object-server.conf to enable the recon middleware by adding a pipeline entry
232+
and setting its one option::
233+
234+
[pipeline:main]
235+
pipeline = recon object-server
236+
237+
[filter:recon]
238+
use = egg:swift#recon
239+
recon_cache_path = /var/cache/swift
240+
241+
The recon_cache_path simply sets the directory where stats for a few items will
242+
be stored. Depending on the method of deployment you may need to create this
243+
directory manually and ensure that swift has read/write.
244+
245+
If you wish to enable reporting of replication times you can enable recon
246+
support in the object-replicator section of the object-server.conf::
247+
248+
[object-replicator]
249+
...
250+
recon_enable = yes
251+
recon_cache_path = /var/cache/swift
252+
253+
Finally if you also wish to track asynchronous pending's you will need to setup
254+
a cronjob to run the swift-recon-cron script periodically::
255+
256+
*/5 * * * * swift /usr/bin/swift-recon-cron /etc/swift/object-server.conf
257+
258+
Once enabled a GET request for "/recon/<metric>" to the object server will
259+
return a json formatted response::
260+
261+
fhines@ubuntu:~$ curl -i http://localhost:6030/recon/async
262+
HTTP/1.1 200 OK
263+
Content-Type: application/json
264+
Content-Length: 20
265+
Date: Tue, 18 Oct 2011 21:03:01 GMT
266+
267+
{"async_pending": 0}
268+
269+
The following metrics and telemetry are currently exposed:
270+
271+
================== ====================================================
272+
Request URI Description
273+
------------------ ----------------------------------------------------
274+
/recon/load returns 1,5, and 15 minute load average
275+
/recon/async returns count of async pending
276+
/recon/mem returns /proc/meminfo
277+
/recon/replication returns last logged object replication time
278+
/recon/mounted returns *ALL* currently mounted filesystems
279+
/recon/unmounted returns all unmounted drives if mount_check = True
280+
/recon/diskusage returns disk utilization for storage devices
281+
/recon/ringmd5 returns object/container/account ring md5sums
282+
/recon/quarantined returns # of quarantined objects/accounts/containers
283+
================== ====================================================
284+
285+
This information can also be queried via the swift-recon command line utility::
286+
287+
fhines@ubuntu:~$ swift-recon -h
288+
===============================================================================
289+
Usage:
290+
usage: swift-recon [-v] [--suppress] [-a] [-r] [-u] [-d] [-l] [--objmd5]
291+
292+
293+
Options:
294+
-h, --help show this help message and exit
295+
-v, --verbose Print verbose info
296+
--suppress Suppress most connection related errors
297+
-a, --async Get async stats
298+
-r, --replication Get replication stats
299+
-u, --unmounted Check cluster for unmounted devices
300+
-d, --diskusage Get disk usage stats
301+
-l, --loadstats Get cluster load average stats
302+
-q, --quarantined Get cluster quarantine stats
303+
--objmd5 Get md5sums of object.ring.gz and compare to local
304+
copy
305+
--all Perform all checks. Equivalent to -arudlq --objmd5
306+
-z ZONE, --zone=ZONE Only query servers in specified zone
307+
--swiftdir=SWIFTDIR Default = /etc/swift
308+
309+
For example, to obtain quarantine stats from all hosts in zone "3"::
310+
311+
fhines@ubuntu:~$ swift-recon -q --zone 3
312+
===============================================================================
313+
[2011-10-18 19:36:00] Checking quarantine dirs on 1 hosts...
314+
[Quarantined objects] low: 4, high: 4, avg: 4, total: 4
315+
[Quarantined accounts] low: 0, high: 0, avg: 0, total: 0
316+
[Quarantined containers] low: 0, high: 0, avg: 0, total: 0
317+
===============================================================================
318+
319+
225320
------------------------
226321
Debugging Tips and Tools
227322
------------------------

doc/source/misc.rst

+9
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ Healthcheck
9898
:members:
9999
:show-inheritance:
100100

101+
.. _recon:
102+
103+
Recon
104+
===========
105+
106+
.. automodule:: swift.common.middleware.recon
107+
:members:
108+
:show-inheritance:
109+
101110
.. _memecached:
102111

103112
MemCacheD

etc/object-server.conf-sample

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# log_level = INFO
1414

1515
[pipeline:main]
16-
pipeline = object-server
16+
pipeline = recon object-server
1717

1818
[app:object-server]
1919
use = egg:swift#object
@@ -35,6 +35,10 @@ use = egg:swift#object
3535
# Content-Type, etag, Content-Length, or deleted
3636
# allowed_headers = Content-Encoding, Content-Disposition, X-Object-Manifest
3737

38+
[filter:recon]
39+
use = egg:swift#recon
40+
recon_cache_path = /var/cache/swift
41+
3842
[object-replicator]
3943
# You can override the default log routing for this app here (don't use set!):
4044
# log_name = object-replicator
@@ -55,6 +59,9 @@ use = egg:swift#object
5559
# lockup_timeout = 1800
5660
# The replicator also performs reclamation
5761
# reclaim_age = 604800
62+
# enable logging of replication stats for recon
63+
# recon_enable = no
64+
# recon_cache_path = /var/cache/swift
5865

5966
[object-updater]
6067
# You can override the default log routing for this app here (don't use set!):

0 commit comments

Comments
 (0)