From 86baab300d8fe5b4c5c5af76751085197694e5ba Mon Sep 17 00:00:00 2001 From: Huu Nguyen Date: Thu, 16 Feb 2017 13:26:35 -0800 Subject: [PATCH] Add DTR health check explanations --- .../admin/configure/use-a-load-balancer.md | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/datacenter/dtr/2.2/guides/admin/configure/use-a-load-balancer.md b/datacenter/dtr/2.2/guides/admin/configure/use-a-load-balancer.md index 5664052b37..64770ae51e 100644 --- a/datacenter/dtr/2.2/guides/admin/configure/use-a-load-balancer.md +++ b/datacenter/dtr/2.2/guides/admin/configure/use-a-load-balancer.md @@ -4,8 +4,9 @@ description: Learn how to configure a load balancer to balance user requests acr keywords: docker, dtr, load balancer --- -Once you’ve joined multiple DTR replicas nodes for high-availability, you can -configure your own load balancer to balance user requests across all replicas. +Once you’ve joined multiple DTR replicas nodes for +[high-availability](set-up-high-availability.md), you can configure your own +load balancer to balance user requests across all replicas. ![](../../images/use-a-load-balancer-1.svg) @@ -23,9 +24,36 @@ Make sure you configure your load balancer to: * Load balance TCP traffic on ports 80 and 443 * Not terminate HTTPS connections -* Use the `/health` endpoint on each DTR replica, to check if -the replica is healthy and if it should remain on the load balancing pool or -not +* Use the `/health` endpoint (note the lack of an `/api/v0/` in the path) on each +DTR replica, to check if the replica is healthy and if it should remain on the +load balancing pool or not + +## Health check endpoints + +The `/health` endpoint returns a JSON object for the replica being queried with +`"Healthy"` as one of the keys. Any response other than a 200 HTTP status code +and `"Healthy":true` means the replica is unsuitable for taking requests. If +the API server is still up, the returned JSON object will have an `"Error"` key +with more details. More specifically, these issues can be in any of these +services: + +* Storage container (registry) +* Authorization (garant) +* Metadata persistence (rethinkdb) +* Content trust (notary) + +Note that this endpoint is for checking the health of a *single* replica. To get +the health of every replica in a cluster, querying each individual replica is +the preferred way to do it in real time. + +The `/api/v0/meta/cluster_status` endpoint returns a JSON object for the entire +cluster *as observed* by the replica being queried. Health status for the +replicas is available in the `"replica_health"` key. These statuses are taken +from a cache which is updated by each replica individually. + +In addition, this endpoint returns a dump of the rethink system tables +which can be rather large (~45 KB) for a status endpoint. + ## Where to go next