# Health Check

We can enable health checks at gateways cluster level.

When the health check is enabled, edge-admin will send a request to the edge-node to check if the edge-node is health. If it does not meet expectations, the node is considered unhealthy.

Note: the network from edge-admin to edge-node should be connectable before enabling health check, otherwise the node will be considered unhealthy by admin due to the bad network.

# Turn on the gateway cluster health check

We first click into the Gateway page, which lists the gateway clusters that already exist.

We click on the edit button for a gateway cluster and we see a health check switch

After enabling the health check, we can further configure the health check parameters.

Edge supports three health check modes:

  1. tcp
  2. http
  3. https

means that the edge admin will send such request to the edge node:

  1. tcp connection
  2. http request
  3. https request

For tcp check mode, the node is considered healthy only if the tcp connection is successful. For http/https mode, you can also configure the desired response status code, or the string pattern that the response body needs to contain.

Clicking save will enable the health check.

When the number of consecutive unhealthy checks for a gateway node reaches the configured threshold, the Edge will automatically mark the node as "offline" (the green indicator in front of the node IP will turn red in the web page). This means that the node is automatically removed from DNS and cluster caching services.

We can also view the specific logs of the health check:.

Here we can see the number of recent successful/failed checks for each node and the reason for the failure.