With a load balancer, users can access MSR using a single domain name.
Once you have achieved high availability by joining multiple MSR replica nodes,
you can configure a load balancer to balance user requests across those
replicas. The load balancer detects when a replica fails and immediately stops
forwarding requests to it, thus ensuring that the failure goes unnoticed by
users.
MSR does not provide a load balancing service. You must use either an
on-premises or cloud-based load balancer to balance requests across
multiple MSR replicas.
Important
Additional steps are needed to use the same load balancer with both MSR and
MKE. For more information, refer to Configure a load balancer
in the MKE documentation.
MSR exposes several endpoints that you can use to assess the health of an MSR
replica:
/_ping
Verifies whether the MSR replica is healthy. This is useful for load
balancing and other automated health check tasks. This endpoint is
unauthenticated.
/nginx_status
Returns the number of connections handled by the MSR NGINX front end.
/api/v0/meta/cluster_status
Returns detailed information about all MSR replicas.
You can use the unauthenticated /_ping endpoint on each MSR replica,
to check the health status of the replica and whether it should remain in the
load balancing pool or not.
The /_ping endpoint returns a JSON object for the replica being
queried that takes the following form:
{"Error":"<error-message>",
"Healthy":true}
A response of "Healthy":true indicates that the replica is suitable for
taking requests. It also signifies that the HTTP status code is 200.
An unhealthy replica will return 503 as the status code and populate
"Error" with more details on any of the following services:
Storage container (MSR)
Authorization (Garant)
Metadata persistence (RethinkDB)
Content trust (Notary)
Note that the purpose of the /_ping endpoint is to check the health of a
single replica. To obtain the health of every replica in a cluster, you must
individually query each replica.