19364: Document arvados-server check command.
[arvados.git] / doc / admin / health-checks.html.textile.liquid
1 ---
2 layout: default
3 navsection: admin
4 title: Health checks
5 ...
6
7 {% comment %}
8 Copyright (C) The Arvados Authors. All rights reserved.
9
10 SPDX-License-Identifier: CC-BY-SA-3.0
11 {% endcomment %}
12
13 Health check endpoints are found at @/_health/ping@ on many Arvados services.  The purpose of the health check is to offer a simple method of determining if a service can be reached and allow the service to self-report any problems, suitable for integrating into operational alert systems.
14
15 To access health check endpoints, services must be configured with a "management token":management-token.html .
16
17 Health check endpoints return a JSON object with the field @health@.  This has a value of either @OK@ or @ERROR@.  On error, it may also include a  field @error@ with additional information.  Examples:
18
19 <pre>
20 {
21   "health": "OK"
22 }
23 </pre>
24
25 <pre>
26 {
27   "health": "ERROR"
28   "error": "Inverted polarity in the warp core"
29 }
30 </pre>
31
32 h2. Health check aggregator
33
34 The service @arvados-health@ performs health checks on all configured services and returns a single value of @OK@ or @ERROR@ for the entire cluster.  It exposes the endpoint @/_health/all@ .
35
36 The healthcheck aggregator uses the @Services@ section of the cluster-wide @config.yml@ configuration file.
37
38 h2. Health check command
39
40 The @arvados-server check@ command is another way to perform the same health checks as the health check aggregator service. It does not depend on the aggregator service.
41
42 If all checks pass, it writes @health check OK@ to stderr (unless the @-quiet@ flag is used) and exits 0. Otherwise, it writes error messages to stderr and exits with error status.
43
44 @arvados-server check -yaml@ outputs a YAML document on stdout with additional details about each service endpoint that was checked.
45
46 {% codeblock as yaml %}
47 Checks:
48   "arvados-api-server+http://localhost:8004/_health/ping":
49     ClockTime: "2022-11-16T16:08:57Z"
50     ConfigSourceSHA256: e2c086ae3dd290cf029cb3fe79146529622279b6280cf6cd17dc8d8c30daa57f
51     ConfigSourceTimestamp: "2022-11-07T18:08:24.539545Z"
52     HTTPStatusCode: 200
53     Health: OK
54     Response:
55       health: OK
56     ResponseTime: 0.017159
57     Server: nginx/1.14.0 + Phusion Passenger(R) 6.0.15
58     Version: 2.5.0~dev20221116141533
59   "arvados-controller+http://localhost:8003/_health/ping":
60     ClockTime: "2022-11-16T16:08:57Z"
61     ConfigSourceSHA256: e2c086ae3dd290cf029cb3fe79146529622279b6280cf6cd17dc8d8c30daa57f
62     ConfigSourceTimestamp: "2022-11-07T18:08:24.539545Z"
63     HTTPStatusCode: 200
64     Health: OK
65     Response:
66       health: OK
67     ResponseTime: 0.004748
68     Server: ""
69     Version: 2.5.0~dev20221116141533 (go1.18.8)
70 # ...
71 {% endcodeblock %}