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.
This allows users to access DTR using a centralized domain name. If a replica goes down, the load balancer can detect that and stop forwarding requests to it, so that the failure goes unnoticed by users.
DTR exposes several endpoints you can use to assess if a DTR replica is healthy or not:
/_ping
: Is an unauthenticated endpoint that checks if the DTR
replica is healthy. This is useful for load balancing or other
automated health check tasks./nginx_status
: Returns the number of connections being handled by
the NGINX front-end used by DTR./api/v0/meta/cluster_status
: Returns extensive information about
all DTR replicas.DTR does not provide a load balancing service. You can use an on-premises or cloud-based load balancer to balance requests across multiple DTR replicas.
Important
Additional load balancer requirements for UCP
If you are also using UCP, there are additional requirements if you plan to load balance both UCP and DTR using the same load balancer.
You can use the unauthenticated /_ping
endpoint on each DTR replica,
to check if the replica is healthy and if it should remain in the load
balancing pool or not.
Also, make sure you configure your load balancer to:
Host
HTTP header correctly.The /_ping
endpoint returns a JSON object for the replica being
queried of the form:
{
"Error": "error message",
"Healthy": true
}
A response of "Healthy": true
means the replica is suitable for
taking requests. It is also sufficient to check whether the HTTP status
code is 200.
An unhealthy replica will return 503 as the status code and populate
"Error"
with more details on any one of these services:
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 replica individually is the preferred way to do it in real time.
Use the following examples to configure your load balancer for DTR.
You can deploy your load balancer using: